Skip to content

Commit 9efd375

Browse files
authored
Update UpdateVersions.ps1 to update Directory.Packages.props (#565)
1 parent 5b39d84 commit 9efd375

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

UpdateVersions.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ Get-ChildItem -Recurse packages.config -Path $PSScriptRoot | foreach-object {
4141
Write-Host "Modified " $_.FullName
4242
}
4343

44+
Get-ChildItem -Recurse Directory.Packages.props -Path $PSScriptRoot | foreach-object {
45+
$content = Get-Content $_.FullName -Raw
46+
47+
foreach ($nugetPackageToVersion in $nugetPackageToVersionTable.GetEnumerator())
48+
{
49+
$newVersionString = 'PackageVersion Include="' + $nugetPackageToVersion.Key + '" Version="' + $nugetPackageToVersion.Value + '"'
50+
$oldVersionString = 'PackageVersion Include="' + $nugetPackageToVersion.Key + '" Version="[-.0-9a-zA-Z]*"'
51+
$content = $content -replace $oldVersionString, $newVersionString
52+
}
53+
54+
Set-Content -Path $_.FullName -Value $content
55+
Write-Host "Modified " $_.FullName
56+
}
57+
4458
Get-ChildItem -Recurse *.vcxproj -Path $PSScriptRoot | foreach-object {
4559
$content = Get-Content $_.FullName -Raw
4660

0 commit comments

Comments
 (0)