Skip to content

Instantly share code, notes, and snippets.

View lucasfernog's full-sized avatar

Lucas Fernandes Nogueira lucasfernog

View GitHub Profile
@JonCanning
JonCanning / update.ps1
Last active May 12, 2020 21:15
dotnet nuget update packages
$regex = [regex] 'PackageReference Include="([^"]*)" Version="([^"]*)"'
ForEach ($file in get-childitem . -recurse | where {$_.extension -like "*proj"})
{
$proj = $file.fullname
$content = Get-Content $proj
$match = $regex.Match($content)
if ($match.Success) {
$name = $match.Groups[1].Value
$version = $match.Groups[2].Value
if ($version -notin "-") {