File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 12
12
RootModule = ' Az.Tools.Installer.psm1'
13
13
14
14
# Version number of this module.
15
- ModuleVersion = ' 0.1.0 '
15
+ ModuleVersion = ' 0.1.1 '
16
16
17
17
# Supported PSEditions
18
18
CompatiblePSEditions = ' Core' , ' Desktop'
109
109
# IconUri = ''
110
110
111
111
# ReleaseNotes of this module
112
- ReleaseNotes = ' * the first preview release'
112
+ ReleaseNotes = ' * Fix wildcard error in Install-AzModule
113
+ * Fix syntax errors in Windows Powershell'
113
114
114
115
# Prerelease string of this module
115
116
# Prerelease = ''
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function Update-AzModule {
77
77
Write-Debug " Powershell $ppsedition Version $ ( $PSVersionTable.PSVersion ) "
78
78
79
79
if ($ppsedition -eq " Core" ) {
80
- $allPahts = (Microsoft.PowerShell.Core\Get-Module - Name " Az*" - ListAvailable - ErrorAction Stop). Where ( {$_.Author -eq " Microsoft Corporation" -and $_.Name -match " Az(\.[a-zA-Z0-9]+)?$" }).Path
80
+ $allPahts = (Microsoft.PowerShell.Core\Get-Module - Name " Az*" - ListAvailable - ErrorAction Stop | Where-Object {$_.Author -eq " Microsoft Corporation" -and $_.Name -match " Az(\.[a-zA-Z0-9]+)?$" }).Path
81
81
$allPahts = ($allPahts | Select-String - Pattern " WindowsPowerShell" )
82
82
if ($allPahts ) {
83
83
Write-Warning " Az modules are also installed in WindowsPowerShell. Please update them using WindowsPowerShell."
@@ -96,9 +96,9 @@ function Update-AzModule {
96
96
if ($allToUpdate ) {
97
97
Write-Host - ForegroundColor DarkGreen " The modules to Update:$ ( $allToUpdate | Out-String ) "
98
98
99
- $allToUpdateReordered = @ () + $allToUpdate. Where ( {$_.Name -eq " Az" })
100
- $allToUpdateReordered += $allToUpdate. Where ( {$_.Name -ne " Az" -and $_.Name -ne " Az.Accounts" })
101
- $allToUpdateReordered += $allToUpdate. Where ( {$_.Name -eq " Az.Accounts" })
99
+ $allToUpdateReordered = @ () + ( $allToUpdate | Where-Object {$_.Name -eq " Az" })
100
+ $allToUpdateReordered += $allToUpdate | Where-Object {$_.Name -ne " Az" -and $_.Name -ne " Az.Accounts" }
101
+ $allToUpdateReordered += $allToUpdate | Where-Object {$_.Name -eq " Az.Accounts" }
102
102
103
103
foreach ($module in $allToUpdateReordered ) {
104
104
if (-not $module ) {
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ function Get-AzModuleUpdateList {
33
33
Write-Debug " Retrieving installed Az modules"
34
34
$installModules = @ {}
35
35
try {
36
- ( PowerShellGet\Get-InstalledModule - Name " Az*" - ErrorAction Stop). Where ( {
36
+ PowerShellGet\Get-InstalledModule - Name " Az*" - ErrorAction Stop | Where-Object {
37
37
($_.Author -eq ' Microsoft Corporation' -or $_.CompanyName -eq ' Microsoft Corporation' ) -and ($_.Name -match " Az(\.[a-zA-Z0-9]+)?$" )
38
- }) | ForEach-Object {
38
+ } | ForEach-Object {
39
39
$installModules [$_.Name ] = @ ()
40
40
}
41
41
}
@@ -105,10 +105,10 @@ function Get-AzModuleUpdateList {
105
105
106
106
Write-Debug " The modules to check for update: $ ( $modules.Name ) "
107
107
108
- $modulesToUpdate = $modules. Where ( { ! $installModules.ContainsKey ($_.Name ) -or ! $installModules [$_.Name ] -or [Version ]($_.Version ) -gt [Version ]$installModules [$_.Name ][0 ].Item1 })
108
+ $modulesToUpdate = $modules | Where-Object { ! $installModules.ContainsKey ($_.Name ) -or ! $installModules [$_.Name ] -or [Version ]($_.Version ) -gt [Version ]$installModules [$_.Name ][0 ].Item1 }
109
109
if (" Az" -eq ($modulesToUpdate | Select-Object - First 1 ).Name) {
110
110
$first , $rest = $modulesToUpdate
111
- $modulesToUpdate = (@ () + $rest + $first )
111
+ $modulesToUpdate = (@ () + $rest + $first ) | Where-Object { $_ -ne $null }
112
112
}
113
113
114
114
If (-not $modulesToUpdate ) {
You can’t perform that action at this time.
0 commit comments