Created
March 8, 2021 20:57
-
-
Save RobotOptimist/b3d5127c638fc9e8a48bba139c42c72e to your computer and use it in GitHub Desktop.
PowerShell get nuget versions and update package.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $nugetValues = Find-Package -Source "The Feed" | Select-Object Name, Version | |
| $filePath = "muh\path\mmkay\packages.config" | |
| [xml]$file = Get-Content -Path $filePath | |
| foreach ($package in $file.packages.package) { | |
| $nugetVersion = ($nugetValues | Where-Object Name -eq $package.id | Select-Object Version).Version | |
| $nugetVersion | |
| if ($null -ne $nugetVersion -and $nugetVersion -ne '') { | |
| $package.version = $nugetVersion | |
| } | |
| } | |
| $file.Save($filePath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment