diff --git a/scripts/UpdateRequiredModules.ps1 b/scripts/UpdateRequiredModules.ps1 index 143ae5fc..ca2525bd 100644 --- a/scripts/UpdateRequiredModules.ps1 +++ b/scripts/UpdateRequiredModules.ps1 @@ -4,11 +4,9 @@ $existingmodule = @() $newmodule = @() $updated = $false $data.RequiredModules | ForEach-Object { - $moduleVersion = $_.RequiredVersion - [int]$moduleVersionInt = $moduleVersion.Replace('.',',') - $galleryVersion = (Find-Module -Name $_.ModuleName).Version - [int]$galleryVersionInt = $galleryVersion.Replace('.',',') - if ($moduleVersionInt -lt $galleryVersionInt) { + $moduleVersion = New-Object System.Version($_.RequiredVersion) + $galleryVersion = New-Object System.Version((Find-Module -Name $_.ModuleName).Version) + if ($moduleVersion -lt $galleryVersion) { $newmodule = @{ "ModuleName" = $_.ModuleName "RequiredVersion" = $galleryVersion