Skip to content

Commit 74b4aee

Browse files
dagorozisra-felwyunchi-ms
authored
Add culture info to version parsing (#13343)
* fix parsing bug * add default values * add culture info * update changelog Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent 2a62732 commit 74b4aee

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Resources/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Upcoming Release
2121
* Fixed an issue where What-If shows two resource group scopes with different casing
2222
* Updated `Export-AzResourceGroup` to use the SDK.
23+
* Added culture info to parse methods
2324

2425
## Version 3.0.0
2526
* Fixed parsing bug

src/Resources/Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2121
using Newtonsoft.Json;
2222
using System;
23+
using System.Globalization;
2324
using System.IO;
2425
using System.Management.Automation;
2526

@@ -273,7 +274,7 @@ public override void ExecuteCmdlet()
273274
}
274275
// ensure that if ConditionVersion is empty in any way, it becomes null
275276
ConditionVersion = string.IsNullOrEmpty(ConditionVersion) ? null : string.IsNullOrWhiteSpace(ConditionVersion) ? null : ConditionVersion;
276-
double _conditionVersion = double.Parse(ConditionVersion ?? "2.0");
277+
double _conditionVersion = double.Parse(ConditionVersion ?? "2.0", CultureInfo.InvariantCulture);
277278
if (_conditionVersion < 2.0)
278279
{
279280
WriteExceptionError(new ArgumentException("Argument -ConditionVersion must be greater or equal than 2.0"));

0 commit comments

Comments
 (0)