forked from lstratman/EasyConnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetAssemblyVersion.ps1
37 lines (27 loc) · 1.34 KB
/
SetAssemblyVersion.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
param([string] $newVersion)
$assemblyPattern = "[0-9]+(\.([0-9]+|\*)){1,3}"
$foundFiles = Get-ChildItem .\*AssemblyInfo.cs -Recurse
foreach ($file in $foundFiles)
{
(Get-Content $file) | ForEach-Object {$_ -Replace ("""" + $assemblyPattern + """"), ("""" + $newVersion + """") } | Set-Content $file
}
$foundFiles = Get-ChildItem .\*.wxs -Recurse
foreach ($file in $foundFiles)
{
(Get-Content $file) | ForEach-Object {$_ -Replace ("ProductVersion=""" + $assemblyPattern + """"), ("ProductVersion=""" + $newVersion + """") } | Set-Content $file
}
$foundFiles = Get-ChildItem .\*.nuspec -Recurse
foreach ($file in $foundFiles)
{
(Get-Content $file) | ForEach-Object {$_ -Replace ("<version>" + $assemblyPattern + "</version>"), ("<version>" + $newVersion + "</version>") } | Set-Content $file
}
$foundFiles = Get-ChildItem chocolateyInstall.ps1 -Recurse
foreach ($file in $foundFiles)
{
(Get-Content $file) | ForEach-Object {$_ -Replace ("version = """ + $assemblyPattern + """"), ("version = """ + $newVersion + """") } | Set-Content $file
}
$foundFiles = Get-ChildItem AppxManifest.xml -Recurse
foreach ($file in $foundFiles)
{
(Get-Content $file) | ForEach-Object {$_ -Replace (" Version=""" + $assemblyPattern + """"), (" Version=""" + $newVersion + """") } | Set-Content $file
}