diff --git a/src/Resources/Resources.sln b/src/Resources/Resources.sln index f6c4ea5a567f..35e17d2fc5ff 100644 --- a/src/Resources/Resources.sln +++ b/src/Resources/Resources.sln @@ -52,6 +52,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU {6BD4D521-DAFB-472B-A803-81F053AB1396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6BD4D521-DAFB-472B-A803-81F053AB1396}.Debug|Any CPU.Build.0 = Debug|Any CPU {6BD4D521-DAFB-472B-A803-81F053AB1396}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Resources/Resources/ChangeLog.md b/src/Resources/Resources/ChangeLog.md index fb67d7b6562e..4f4babacd9cd 100644 --- a/src/Resources/Resources/ChangeLog.md +++ b/src/Resources/Resources/ChangeLog.md @@ -23,6 +23,7 @@ * Fixed an issue where What-If shows two resource group scopes with different casing * Updated `Export-AzResourceGroup` to use the SDK. * Added culture info to parse methods +* Changed Double parser for version parser ## Version 3.0.0 * Fixed parsing bug diff --git a/src/Resources/Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs b/src/Resources/Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs index 66c495434682..bfd6a60fbcc8 100644 --- a/src/Resources/Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs +++ b/src/Resources/Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs @@ -274,8 +274,8 @@ public override void ExecuteCmdlet() } // ensure that if ConditionVersion is empty in any way, it becomes null ConditionVersion = string.IsNullOrEmpty(ConditionVersion) ? null : string.IsNullOrWhiteSpace(ConditionVersion) ? null : ConditionVersion; - double _conditionVersion = double.Parse(ConditionVersion ?? "2.0", CultureInfo.InvariantCulture); - if (_conditionVersion < 2.0) + var _conditionVersion = Version.Parse(ConditionVersion ?? "2.0"); + if (_conditionVersion.Major < 2) { WriteExceptionError(new ArgumentException("Argument -ConditionVersion must be greater or equal than 2.0")); return; diff --git a/src/Resources/Resources/RoleAssignments/SetAzureRoleAssignmentCommand.cs b/src/Resources/Resources/RoleAssignments/SetAzureRoleAssignmentCommand.cs index 66ec6ddcd7fa..78a51b512621 100644 --- a/src/Resources/Resources/RoleAssignments/SetAzureRoleAssignmentCommand.cs +++ b/src/Resources/Resources/RoleAssignments/SetAzureRoleAssignmentCommand.cs @@ -112,12 +112,12 @@ public override void ExecuteCmdlet() } // If ConditionVersion is changed, validate it's in the allowed values - var oldConditionVersion = double.Parse(InputObject.ConditionVersion ?? "0.0"); - var newConditionVersion = double.Parse(fetchedRole.ConditionVersion ?? "2.0"); + var oldConditionVersion = Version.Parse(InputObject.ConditionVersion ?? "0.0"); + var newConditionVersion = Version.Parse(fetchedRole.ConditionVersion ?? "2.0"); // A condition version can change but currently we don't support downgrading to 1.0 // we only verify the change if it's a downgrade - if ((oldConditionVersion > newConditionVersion) && (newConditionVersion < 2.0)) + if ((oldConditionVersion > newConditionVersion) && (newConditionVersion.Major < 2)) { throw new ArgumentException("Condition version different than '2.0' is not supported for update operations"); }