10
10
11
11
function SetMsiVersion ([string ]$FilePath , [string ]$MsiVersion )
12
12
{
13
- $wxsPath = Join-Path $FilePath " azurecmd.wxs"
13
+ $wxsPath = Join-Path $FilePath " setup\ azurecmd.wxs"
14
14
15
15
Write-Output " Updating File: $wxsPath "
16
16
$content = Get-Content $wxsPath
@@ -25,24 +25,53 @@ function SetMsiVersion([string]$FilePath, [string]$MsiVersion)
25
25
26
26
function SetMsiReleaseString ([string ]$FilePath , [string ]$MsiRelease )
27
27
{
28
- $wxsPath = Join-Path $FilePath " azurecmd.wxs"
28
+ $wxsPath = Join-Path $FilePath " setup\ azurecmd.wxs"
29
29
30
30
Write-Output " Updating File: $wxsPath "
31
31
$content = Get-Content $wxsPath
32
32
$matches = ([regex ]::matches($content , ' \<\?define productName="Microsoft Azure PowerShell - ([a-zA-z]+\s[\d]+)" \?\>' ))
33
33
34
34
$prevousVersion = $matches.Groups [1 ].Value
35
- Write-Output " Found: $prevousVersion "
36
35
37
36
$content = $content.Replace (" <?define productName=`" Microsoft Azure PowerShell - $prevousVersion `" ?>" , " <?define productName=`" Microsoft Azure PowerShell - $MsiRelease `" ?>" )
38
37
39
38
Set-Content - Path $wxsPath - Value $content - Encoding UTF8
40
39
}
41
40
41
+ function AlignAsmPsdReleaseVersion ([string ]$FilePath , [string ]$MsiVersion )
42
+ {
43
+ $psd1Path = Join-Path $FilePath " src\ServiceManagement\Services\Commands.Utilities\Azure.psd1"
44
+
45
+ $content = Get-Content $psd1Path
46
+ $matches = ([regex ]::matches($content , " ModuleVersion = '([\d\.]+)'\s+" ))
47
+
48
+ $packageVersion = $matches.Groups [1 ].Value
49
+ Write-Output " Updating version of $psd1Path from $packageVersion to $MsiVersion "
50
+ $content = $content.Replace (" ModuleVersion = '$packageVersion '" , " ModuleVersion = '$MsiVersion '" )
51
+
52
+ Set-Content - Path $psd1Path - Value $content - Encoding UTF8
53
+ }
54
+
55
+ function AlignArmPsdReleaseVersion ([string ]$FilePath , [string ]$MsiVersion )
56
+ {
57
+ $psd1Path = Join-Path $FilePath " tools\AzureRM\AzureRM.psd1"
58
+
59
+ $content = Get-Content $psd1Path
60
+ $matches = ([regex ]::matches($content , " ModuleVersion = '([\d\.]+)'\s+" ))
61
+
62
+ $packageVersion = $matches.Groups [1 ].Value
63
+ Write-Output " Updating version of $psd1Path from $packageVersion to $MsiVersion "
64
+ $content = $content.Replace (" ModuleVersion = '$packageVersion '" , " ModuleVersion = '$MsiVersion '" )
65
+
66
+ Set-Content - Path $psd1Path - Value $content - Encoding UTF8
67
+ }
68
+
42
69
if (! $Folder )
43
70
{
44
- $Folder = " $PSScriptRoot \..\setup "
71
+ $Folder = " $PSScriptRoot \.."
45
72
}
46
73
47
74
SetMsiVersion $Folder $Version
48
- SetMsiReleaseString $Folder $Release
75
+ SetMsiReleaseString $Folder $Release
76
+ AlignAsmPsdReleaseVersion $Folder $Version
77
+ AlignArmPsdReleaseVersion $Folder $Version
0 commit comments