diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs index 60b2bba83617..2cbf0c61b33b 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs @@ -176,7 +176,7 @@ private bool IsDiscoveryNeeded(string vmName, string rgName, out CSMContainerRes else { //We can have multiple container with same friendly name. - container = containers.Where(c => ContainerHelpers.GetRGNameFromId(c.Properties.ParentContainerId).Equals(rgName.ToLower())).FirstOrDefault(); //TODO need to change. + container = containers.Where(c => ContainerHelpers.GetRGNameFromId(c.Properties.ParentContainerId).Equals(rgName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (container == null) { //Container is not in list of registered container diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs index 2e3f297ac8e7..de54121fc7be 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs @@ -13,6 +13,7 @@ // ---------------------------------------------------------------------------------- using System; +using System.Globalization; using System.Management.Automation; using System.Collections.Generic; using System.Xml; @@ -132,8 +133,9 @@ protected override void ProcessRecord() To = DateTime.UtcNow; } - WriteDebug(String.Format(Resources.StartTimeFilter, System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt")))); - WriteDebug(String.Format(Resources.EndTimeFilter, System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt")))); + DateTimeFormatInfo format = new CultureInfo("en-US").DateTimeFormat; + WriteDebug(String.Format(Resources.StartTimeFilter, System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format)))); + WriteDebug(String.Format(Resources.EndTimeFilter, System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format)))); WriteDebug(String.Format(Resources.OperationFilter, Operation)); WriteDebug(String.Format(Resources.StatusFilter, Status)); WriteDebug(String.Format(Resources.TypeFilter, Type)); @@ -141,8 +143,9 @@ protected override void ProcessRecord() Mgmt.CSMJobQueryObject queryParams = new Mgmt.CSMJobQueryObject() { - StartTime = From.Value.ToString("yyyy-MM-dd hh:mm:ss tt"), - EndTime = To.Value.ToString("yyyy-MM-dd hh:mm:ss tt"), + + StartTime = From.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format), + EndTime = To.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format), Operation = Operation, Status = Status, WorkloadType = Type,