forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateRegistryEntry.ps1
31 lines (26 loc) · 1.37 KB
/
CreateRegistryEntry.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
# e.g. .\CreateRegistryEntry.ps1 2.0.0 2016_07_11 2016_08_08 "Path to shared PS files" "Path to signed PS build artifacts"
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$PSVersion,
[Parameter(Mandatory=$True, Position=1)]
[String]$LastRelease,
[Parameter(Mandatory=$True, Position=2)]
[String]$CurrentRelease,
[Parameter(Mandatory=$True, Position=3)]
[String]$PathToShared,
[Parameter(Mandatory=$True, Position=4)]
[String]$PathToBuildArtifacts
)
$PathToLastRelease = "$PathToShared\$($LastRelease)_PowerShell"
$PathToCurrentRelease = "$PathToShared\$($CurrentRelease)_PowerShell"
New-Item $PathToCurrentRelease -Type Directory > $null
New-Item "$PathToCurrentRelease\pkgs" -Type Directory > $null
Copy-Item "$PathToLastRelease\scripts" "$PathToCurrentRelease" -Recurse
Copy-Item "$PathToLastRelease\removewebpiReg.reg" "$PathToCurrentRelease"
Copy-Item "$PathToLastRelease\webpiReg.reg" "$PathToCurrentRelease"
Copy-Item "$PathToLastRelease\wpilauncher.exe" "$PathToCurrentRelease"
Copy-Item "$PathToBuildArtifacts\signed\AzurePowerShell.msi" "$PathToCurrentRelease"
Copy-Item "$PathToBuildArtifacts\artifacts\*.nupkg" "$PathToCurrentRelease\pkgs"
Rename-Item $PathToCurrentRelease\AzurePowerShell.msi azure-powershell.$PSVersion.msi
(Get-Content $PathToCurrentRelease\webpiReg.reg) -replace $LastRelease, $CurrentRelease | Set-Content $PathToCurrentRelease\webpiReg.reg