forked from microsoft/ApplicationInsights-dotnet-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgradeVersion.ps1
35 lines (24 loc) · 1.07 KB
/
upgradeVersion.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
#$oldFileVersion = "2.0.0-beta3-build04840"
#$newFileVersion = "2.0.0-beta3"
$newVersion = .\NuGet.exe list "Microsoft.ApplicationInsights" -Source https://www.myget.org/F/applicationinsights -Pre -NonInteractive | Select-String -Pattern "Microsoft.ApplicationInsights " | %{$_.Line.Split(" ")} | Select -skip 1
Write-Host $newVersion
$oldVersion = cat .\Global.props | Select-String -Pattern "CoreSdkVersion" | %{$_.Line.Split("<>")} | Select -skip 2 | Select -First 1
Write-Host $oldVersion
(Get-Content Global.props) |
Foreach-Object {$_ -replace $oldVersion, $newVersion} |
Set-Content Global.props
Get-ChildItem -Filter packages.config -Recurse |
foreach-object {
(Get-Content $_.FullName) |
Foreach-Object {$_ -replace $oldVersion, $newVersion} |
Set-Content $_.FullName
}
Get-ChildItem -Filter *proj -Recurse |
foreach-object {
(Get-Content $_.FullName) |
Foreach-Object {$_ -replace $oldVersion, $newVersion} |
Set-Content $_.FullName
(Get-Content $_.FullName) |
Foreach-Object {$_ -replace $oldFileVersion, $newFileVersion} |
Set-Content $_.FullName
}