Skip to content

Commit 5e16434

Browse files
dingmeng-xuelitchiyangMSFT
authored andcommitted
Fix version compare scripts in psm1 (Azure#12356)
1 parent 3bb33cd commit 5e16434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/UpdateModules.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function New-MinimumVersionEntry {
250250

251251
PROCESS {
252252
return "`$module = Get-Module $ModuleName `
253-
if (`$module -ne `$null -and `$module.Version.ToString().CompareTo(`"$MinimumVersion`") -lt 0) `
253+
if (`$module -ne `$null -and `$module.Version -lt [System.Version]`"$MinimumVersion`") `
254254
{ `
255255
Write-Error `"This module requires $ModuleName version $MinimumVersion. An earlier version of $ModuleName is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information.`" -ErrorAction Stop `
256256
} `

0 commit comments

Comments
 (0)