1
1
Param (
2
- [string ]$WinAppSDKVersion = " " ,
3
- [string ]$WinAppSDKVersionOld = " 1.0.0"
2
+ [string ]$WinAppSDKVersion = " "
4
3
)
5
4
6
5
Get-ChildItem - Recurse packages.config - Path $PSScriptRoot | foreach-object {
7
6
$newVersionString = ' package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersion + ' "'
8
- $oldVersionString = ' package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersionOld + ' "'
7
+ $oldVersionString = ' package id="Microsoft.WindowsAppSDK" version="[-.0-9a-zA-Z]* "'
9
8
$content = Get-Content $_.FullName - Raw
10
- $content = $content. replace ( $oldVersionString , $newVersionString )
9
+ $content = $content - replace $oldVersionString , $newVersionString
11
10
Set-Content - Path $_.FullName - Value $content
12
11
Write-Host " Modified " $_.FullName
13
12
}
14
13
15
14
Get-ChildItem - Recurse * .vcxproj - Path $PSScriptRoot | foreach-object {
16
- $newVersionString = ' packages\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion
17
- $oldVersionString = ' packages\Microsoft.WindowsAppSDK.' + $WinAppSDKVersionOld
15
+ $newVersionString = ' packages\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion + ' \ '
16
+ $oldVersionString = ' packages\\ Microsoft.WindowsAppSDK.[-.0-9a-zA-Z]*\\ '
18
17
$content = Get-Content $_.FullName - Raw
19
- $content = $content. replace ( $oldVersionString , $newVersionString )
18
+ $content = $content - replace $oldVersionString , $newVersionString
20
19
Set-Content - Path $_.FullName - Value $content
21
20
Write-Host " Modified " $_.FullName
22
21
}
23
22
24
23
Get-ChildItem - Recurse * .wapproj - Path $PSScriptRoot | foreach-object {
25
24
$newVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersion + ' "'
26
- $oldVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersionOld + ' "'
25
+ $oldVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]* "'
27
26
$content = Get-Content $_.FullName - Raw
28
- $content = $content. replace ( $oldVersionString , $newVersionString )
27
+ $content = $content - replace $oldVersionString , $newVersionString
29
28
Set-Content - Path $_.FullName - Value $content
30
29
Write-Host " Modified " $_.FullName
31
30
}
32
31
33
32
Get-ChildItem - Recurse * .csproj - Path $PSScriptRoot | foreach-object {
34
33
$newVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersion + ' "'
35
- $oldVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersionOld + ' "'
34
+ $oldVersionString = ' PackageReference Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]* "'
36
35
$content = Get-Content $_.FullName - Raw
37
- $content = $content. replace ( $oldVersionString , $newVersionString )
36
+ $content = $content - replace $oldVersionString , $newVersionString
38
37
Set-Content - Path $_.FullName - Value $content
39
38
Write-Host " Modified " $_.FullName
40
39
}
0 commit comments