Skip to content

Commit d321688

Browse files
committed
fix: update ALZ module version checks to use Get-InstalledPSResource and Find-PSResource
Signed-off-by: Jan Egil Ring <janegilring@microsoft.com>
1 parent de5aa81 commit d321688

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/ALZ/Private/Tools/Test-Tooling.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,16 @@ function Test-Tooling {
160160
} else {
161161
# Check if latest ALZ module is installed
162162
Write-Verbose "Checking ALZ module version"
163-
$alzModuleCurrentVersion = Get-InstalledModule -Name ALZ -ErrorAction SilentlyContinue
163+
$alzModuleCurrentVersion = Get-InstalledPSResource -Name ALZ | Select-Object -Property Name, Version
164+
164165
if($null -eq $alzModuleCurrentVersion) {
165166
$checkResults += @{
166167
message = "ALZ module is not correctly installed. Please install the latest version using 'Install-Module ALZ'."
167168
result = "Failure"
168169
}
169170
$hasFailure = $true
170171
}
171-
$alzModuleLatestVersion = Find-Module -Name ALZ
172+
$alzModuleLatestVersion = Find-PSResource -Name ALZ
172173
if ($null -ne $alzModuleCurrentVersion) {
173174
if ($alzModuleCurrentVersion.Version -lt $alzModuleLatestVersion.Version) {
174175
$checkResults += @{

0 commit comments

Comments
 (0)