Skip to content

Commit 09ef610

Browse files
author
dragonfly91
committed
Fix for Bug 4751044:Get-AzureRMBackupContainer will fail in older PSH versions with Venus addition
1 parent 3d9e819 commit 09ef610

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup/Helpers/ContainerHelpers.cs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,19 @@ internal class ContainerHelpers
4040

4141
internal static AzureBackupContainerType GetContainerType(string customerType)
4242
{
43-
CustomerType type = (CustomerType)Enum.Parse(typeof(CustomerType), customerType);
44-
4543
AzureBackupContainerType containerType = 0;
4644

47-
switch (type)
45+
if (string.Compare(customerType, CustomerType.DPM.ToString()) == 0)
4846
{
49-
case CustomerType.DPM:
50-
containerType = AzureBackupContainerType.SCDPM;
51-
break;
52-
case CustomerType.InMage:
53-
break;
54-
case CustomerType.Invalid:
55-
break;
56-
case CustomerType.ManagedContainer:
57-
break;
58-
case CustomerType.OBS:
59-
containerType = AzureBackupContainerType.Windows;
60-
break;
61-
case CustomerType.SBS:
62-
containerType = AzureBackupContainerType.Windows;
63-
break;
64-
case CustomerType.SqlPaaS:
65-
break;
66-
default:
67-
break;
47+
containerType = AzureBackupContainerType.SCDPM;
48+
}
49+
else if (string.Compare(customerType, CustomerType.OBS.ToString()) == 0)
50+
{
51+
containerType = AzureBackupContainerType.Windows;
52+
}
53+
else if (string.Compare(customerType, CustomerType.SBS.ToString()) == 0)
54+
{
55+
containerType = AzureBackupContainerType.Windows;
6856
}
6957

7058
return containerType;

0 commit comments

Comments
 (0)