Skip to content

Commit 6b4f58e

Browse files
author
dragonfly91
committed
Fix for 3892221 : Get-AzureBackupVaultCredentials doesn't save file at specified location
1 parent ddb9c01 commit 6b4f58e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/VaultCredentials/GetAzureBackupVaultCredentials.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,7 @@ public override void ExecuteCmdlet()
8888

8989
// prepare for download
9090
string fileName = string.Format("{0}_{1}.VaultCredentials", displayName, DateTime.UtcNow.ToString("yyyy-dd-M--HH-mm-ss"));
91-
string directoryPath = Path.GetDirectoryName(TargetLocation);
92-
if (directoryPath == null)
93-
{
94-
// TargetLocation is a root path
95-
directoryPath = TargetLocation;
96-
}
97-
string filePath = Path.Combine(directoryPath, fileName);
91+
string filePath = Path.Combine(TargetLocation, fileName);
9892
WriteDebug(string.Format("Saving Vault Credentials to file : {0}", filePath));
9993

10094
File.WriteAllBytes(filePath, Encoding.UTF8.GetBytes(vaultCredsFileContent));

0 commit comments

Comments
 (0)