Created
May 22, 2020 17:50
-
-
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.
This file contains 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
$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