forked from microsoft/WindowsAppSDK-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateVersions.ps1
40 lines (36 loc) · 1.98 KB
/
UpdateVersions.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Param(
[string]$WinAppSDKVersion = "",
[string]$WinAppSDKVersionOld = "1.0.0"
)
Get-ChildItem -Recurse packages.config -Path $PSScriptRoot | foreach-object {
$newVersionString = 'package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersion + '"'
$oldVersionString = 'package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersionOld + '"'
$content = Get-Content $_.FullName -Raw
$content = $content.replace($oldVersionString, $newVersionString)
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
Get-ChildItem -Recurse *.vcxproj -Path $PSScriptRoot | foreach-object {
$newVersionString = 'packages\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion
$oldVersionString = 'packages\Microsoft.WindowsAppSDK.' + $WinAppSDKVersionOld
$content = Get-Content $_.FullName -Raw
$content = $content.replace($oldVersionString, $newVersionString)
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
Get-ChildItem -Recurse *.wapproj -Path $PSScriptRoot | foreach-object {
$newVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersion + '"'
$oldVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersionOld + '"'
$content = Get-Content $_.FullName -Raw
$content = $content.replace($oldVersionString, $newVersionString)
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
Get-ChildItem -Recurse *.csproj -Path $PSScriptRoot | foreach-object {
$newVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersion + '"'
$oldVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersionOld + '"'
$content = Get-Content $_.FullName -Raw
$content = $content.replace($oldVersionString, $newVersionString)
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}