From 04cbd639e08aeb05ebe78b7b597b2d44a2388113 Mon Sep 17 00:00:00 2001 From: Steve Shi Date: Thu, 20 Sep 2018 12:19:33 +0800 Subject: [PATCH] Wrong string filtering Wrong string filtering causing dependency module version invalid. For example, AzureRm.Automation has $PackageDetails.entry.properties.Dependencies as AzureRM.Profile:[5.5.1, ):. The original $DependencyVersion will become "5.5.1, )" in this case. Just replace any characters that are not dot or numbers will work. --- Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1 b/Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1 index bd7a27c..475ba0b 100644 --- a/Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1 +++ b/Utility/ARM/Update-ModulesInAutomationToLatestVersion.ps1 @@ -131,7 +131,7 @@ function _doImport { if($_ -and $_.Length -gt 0) { $Parts = $_.Split(":") $DependencyName = $Parts[0] - $DependencyVersion = ($Parts[1] -replace '\[', '') -replace '\]', '' + $DependencyVersion = $Parts[1] -replace '[^0-9.]' # check if we already imported this dependency module during execution of this script if(!$ModulesImported.Contains($DependencyName)) {