Skip to content

Commit 57c214b

Browse files
committed
Fix for tests
Powershell instance within another not good.
1 parent 8353f36 commit 57c214b

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClientHelper.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,6 @@ public static void ValidateStorageAccountAssociation(string azureStorageAccount)
8181

8282
bool associatedAccount = false;
8383

84-
using (System.Management.Automation.PowerShell powerShellInstance = System.Management.Automation.PowerShell.Create())
85-
{
86-
powerShellInstance.AddCommand("Get-AzureStorageAccount");
87-
Collection<PSObject> powershellOutput = powerShellInstance.Invoke();
88-
89-
foreach (var storage in powershellOutput)
90-
{
91-
if (storage.BaseObject is StorageServicePropertiesOperationContext)
92-
{
93-
StorageServicePropertiesOperationContext storageAccount = (StorageServicePropertiesOperationContext)storage.BaseObject;
94-
if (azureStorageAccount.Equals(storageAccount.StorageAccountName, StringComparison.OrdinalIgnoreCase))
95-
{
96-
associatedAccount = true;
97-
break;
98-
}
99-
}
100-
}
101-
}
102-
10384
if (!associatedAccount)
10485
{
10586
throw new InvalidOperationException(

0 commit comments

Comments
 (0)