|
| 1 | +$AzureRMProfileVersion = "0.9.8"; |
| 2 | + |
1 | 3 | $AzureRMModules = @{
|
2 | 4 | "Azure.Storage" = "0.9.8";
|
3 | 5 | "AzureRM.ApiManagement" = "0.9.8";
|
@@ -56,18 +58,31 @@ function Update-AzureRM
|
56 | 58 | }
|
57 | 59 |
|
58 | 60 | Write-Output "Installing AzureRM modules."
|
| 61 | + $minVer = $AzureRMProfileVersion |
| 62 | + $maxVer = "$($args[1].Split(".")[0]).9999.0" |
| 63 | + if ([string]::IsNullOrWhiteSpace($Repository)) |
| 64 | + { |
| 65 | + Install-Module -Name AzureRM.Profile -Scope $Scope -MinimumVersion $minVer -MaximumVersion $maxVer |
| 66 | + } else { |
| 67 | + Install-Module -Name AzureRM.Profile -Repository $Repository -Scope $Scope -MinimumVersion $minVer -MaximumVersion $maxVer |
| 68 | + } |
| 69 | + $v = (Get-InstalledModule -Name AzureRM.Profile)[0].Version.ToString() |
| 70 | + Write-Output "AzureRM.Profile $v installed..." |
59 | 71 |
|
60 |
| - $result = $AzureRMModules | ForEach { |
| 72 | + $result = $AzureRMModules.Keys | ForEach { |
61 | 73 | Start-Job -Name $_ -ScriptBlock {
|
62 |
| - if ([string]::IsNullOrWhiteSpace($args[1])) |
| 74 | + $minVer = $args[1] |
| 75 | + $maxVer = "$($args[1].Split(".")[0]).9999.0" |
| 76 | + |
| 77 | + if ([string]::IsNullOrWhiteSpace($args[2])) |
63 | 78 | {
|
64 |
| - Install-Module -Name $args[0] -Scope $args[2] |
| 79 | + Install-Module -Name $args[0] -Scope $args[3] -MinimumVersion $minVer -MaximumVersion $maxVer |
65 | 80 | } else {
|
66 |
| - Install-Module -Name $args[0] -Repository $args[1] -Scope $args[2] |
| 81 | + Install-Module -Name $args[0] -Repository $args[2] -Scope $args[3] -MinimumVersion $minVer -MaximumVersion $maxVer |
67 | 82 | }
|
68 | 83 | $v = (Get-InstalledModule -Name $args[0])[0].Version.ToString()
|
69 | 84 | Write-Output "$($args[0]) $v installed..."
|
70 |
| - } -ArgumentList $_; $Repository; $Scope } |
| 85 | + } -ArgumentList $_; $AzureRMModules[$_]; $Repository; $Scope } |
71 | 86 |
|
72 | 87 | $AzureRMModules | ForEach {Get-Job -Name $_ | Wait-Job | Receive-Job }
|
73 | 88 | }
|
|
0 commit comments