Skip to content

Instantly share code, notes, and snippets.

@jobou363
Created May 22, 2020 17:50
Show Gist options
  • Save jobou363/85fd6a854fd29ce96af203684f111128 to your computer and use it in GitHub Desktop.
Save jobou363/85fd6a854fd29ce96af203684f111128 to your computer and use it in GitHub Desktop.
Nuget package script for updating allowedVersions to current specified range from 1 to 1000.
$versionname = "4.8.0-alpha-JIRA-1000."
$version = "$versionname.50"
$packages = "SaiAdNet", "Sai.Core", "Sai.Infra.Cqs", "SaiAdNet.Core", "SaiAdNet.Data", "SaiAdNet.DataProvider"
$file = "D:\Git\sai-sharp-feature\SaiSharp.AdNetIntegration\packages.config"
[xml]$XmlDocument = Get-Content -Path $file
Foreach($p in $XmlDocument.packages.package){
#$p.Id
if($packages.Contains($p.Id))
{
Write-Host "update allowed version for {$($p.Id)}}"
$p.SetAttribute("allowedVersions", "($($versionname)1,$($versionname)1000)")
$p
}
}
$XmlDocument.Save($file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment