Skip to content

Commit f1d8694

Browse files
author
maddieclayton
committed
Add more files
1 parent 68dd217 commit f1d8694

File tree

26 files changed

+34
-33
lines changed

26 files changed

+34
-33
lines changed

src/ResourceManager/Automation/Commands.Automation/Cmdlet/GetAzureAutomationDscOnboardingMetaconfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public SwitchParameter Force
6060
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
6161
public override void ExecuteCmdlet()
6262
{
63+
OutputFolder = ResolveUserPath(OutputFolder);
6364
this.ConfirmAction(
6465
this.Force.IsPresent,
6566
string.Format(CultureInfo.CurrentCulture, Resources.DscMetaMofHasKeysWarning),

src/ResourceManager/Automation/Commands.Automation/Cmdlet/ImportAzureAutomationDscNodeConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public override void ExecuteCmdlet()
7777
{
7878
if (ShouldProcess(Path, VerbsData.Import))
7979
{
80+
Path = ResolveUserPath(Path);
8081
var nodeName = System.IO.Path.GetFileNameWithoutExtension(Path);
8182
var nodeConfigurationName = ConfigurationName + "." + nodeName;
8283
NodeConfiguration nodeConfigurationModel = null;

src/ResourceManager/Automation/Commands.Automation/Cmdlet/NewAzureAutomationCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class NewAzureAutomationCertificate : AzureAutomationBaseCmdlet
7070
protected override void AutomationProcessRecord()
7171
{
7272

73-
var createdCertificate = this.AutomationClient.CreateCertificate(this.ResourceGroupName, this.AutomationAccountName, this.Name, this.ResolvePath(this.Path), this.Password, this.Description, this.Exportable.IsPresent);
73+
var createdCertificate = this.AutomationClient.CreateCertificate(this.ResourceGroupName, this.AutomationAccountName, this.Name, this.ResolvePath(Path), this.Password, this.Description, this.Exportable.IsPresent);
7474

7575
this.WriteObject(createdCertificate);
7676
}

src/ResourceManager/AzureBatch/Commands.Batch/Files/GetBatchNodeFileContentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class GetBatchNodeFileContentCommand : BatchObjectModelCmdletBase
9696

9797
public override void ExecuteCmdlet()
9898
{
99-
DestinationPath = ResolvePath(DestinationPath);
99+
DestinationPath = ResolveUserPath(DestinationPath);
100100
if (this.ByteRangeEnd != null && this.ByteRangeStart == null)
101101
{
102102
this.ByteRangeStart = 0;

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Action/SaveAzureVMImageCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public override void ExecuteCmdlet()
8888
result.EndTime = DateTime.Now;
8989
if (!string.IsNullOrWhiteSpace(this.Path))
9090
{
91-
File.WriteAllText(this.Path, op.Body.Resources[0].ToString());
91+
File.WriteAllText(ResolveUserPath(this.Path), op.Body.Resources[0].ToString());
9292
}
9393
WriteObject(result);
9494
});

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneCommands/ExportAzureRmDataLakeStoreItem.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public class ExportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
109109
public override void ExecuteCmdlet()
110110
{
111111
// We will let this throw itself if the path they give us is invalid
112-
var powerShellReadyPath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(Destination);
112+
var powerShellReadyPath = ResolveUserPath(Destination);
113113
ConfirmAction(
114114
VerbsData.Export,
115115
Path.TransformedPath,
@@ -119,8 +119,7 @@ public override void ExecuteCmdlet()
119119
{
120120
if (ParameterSetName.Equals(DiagnosticParameterSetName) && DiagnosticLogLevel != LogLevel.None)
121121
{
122-
var diagnosticPath =
123-
SessionState.Path.GetUnresolvedProviderPathFromPSPath(DiagnosticLogPath);
122+
var diagnosticPath = ResolveUserPath(DiagnosticLogPath);
124123
DataLakeStoreFileSystemClient.SetupFileLogging(DiagnosticLogLevel, diagnosticPath);
125124
}
126125

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneCommands/ImportAzureRmDataLakeStoreItem.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public class ImportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
118118

119119
public override void ExecuteCmdlet()
120120
{
121-
var powerShellSourcePath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(Path);
121+
var powerShellSourcePath = ResolveUserPath(Path);
122122
ConfirmAction(
123123
Resources.UploadFileMessage,
124124
Destination.TransformedPath,
@@ -128,8 +128,7 @@ public override void ExecuteCmdlet()
128128
{
129129
if (ParameterSetName.Equals(DiagnosticParameterSetName) && DiagnosticLogLevel != LogLevel.None)
130130
{
131-
var diagnosticPath =
132-
SessionState.Path.GetUnresolvedProviderPathFromPSPath(DiagnosticLogPath);
131+
var diagnosticPath = ResolveUserPath(DiagnosticLogPath);
133132
DataLakeStoreFileSystemClient.SetupFileLogging(DiagnosticLogLevel, diagnosticPath);
134133
}
135134

src/ResourceManager/DeviceProvisioningServices/Commands.DeviceProvisioningServices/Cmdlet/IotDpsCertificates/AddAzureRmIotDeviceProvisioningServiceCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class AddAzureRmIoTDeviceProvisioningServiceCertificate : IotDpsBaseCmdle
114114

115115
public override void ExecuteCmdlet()
116116
{
117-
Path = ResolvePath(Path);
117+
Path = ResolveUserPath(Path);
118118
if (ShouldProcess(Name, DPSResources.AddCertificate))
119119
{
120120
switch (ParameterSetName)

src/ResourceManager/DeviceProvisioningServices/Commands.DeviceProvisioningServices/Cmdlet/IotDpsCertificates/SetAzureRmIotDeviceProvisioningServiceCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class SetAzureRmIoTDeviceProvisioningServiceCertificate : IotDpsBaseCmdle
111111

112112
public override void ExecuteCmdlet()
113113
{
114-
Path = ResolvePath(Path);
114+
Path = ResolveUserPath(Path);
115115
if (ShouldProcess(Name, DPSResources.SetCertificate))
116116
{
117117
switch (ParameterSetName)

src/ResourceManager/IotHub/Commands.IotHub/IotHub/AddAzureRmIotHubCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class AddAzureRmIotHubCertificate : IotHubBaseCmdlet
104104

105105
public override void ExecuteCmdlet()
106106
{
107-
Path = ResolvePath(Path);
107+
Path = ResolveUserPath(Path);
108108
if (ShouldProcess(CertificateName, Properties.Resources.AddIotHubCertificate))
109109
{
110110
string certificate = string.Empty;

src/ResourceManager/IotHub/Commands.IotHub/IotHub/SetAzureRmIotHubVerifiedCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class SetAzureRmIotHubVerifiedCertificate : IotHubBaseCmdlet
112112

113113
public override void ExecuteCmdlet()
114114
{
115-
Path = ResolvePath(Path);
115+
Path = ResolveUserPath(Path);
116116
if (ShouldProcess(CertificateName, Properties.Resources.VerifyIotHubCertificate))
117117
{
118118
string certificate = string.Empty;

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ImportAzureKeyVaultCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public override void ExecuteCmdlet()
179179

180180
internal X509Certificate2Collection InitializeCertificateCollection()
181181
{
182-
FileInfo certFile = new FileInfo(this.GetUnresolvedProviderPathFromPSPath(this.FilePath));
182+
FileInfo certFile = new FileInfo(ResolveUserPath(this.FilePath));
183183
if (!certFile.Exists)
184184
{
185185
throw new FileNotFoundException(string.Format(KeyVaultProperties.Resources.CertificateFileNotFound, this.FilePath));

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/ManagedStorageAccounts/RestoreAzureKeyVaultManagedStorageAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override void ExecuteCmdlet()
9595

9696
if (ShouldProcess(VaultName, Properties.Resources.RestoreManagedStorageAccount))
9797
{
98-
var resolvedFilePath = this.GetUnresolvedProviderPathFromPSPath(InputFile);
98+
var resolvedFilePath = this.ResolveUserPath(InputFile);
9999

100100
if (!AzureSession.Instance.DataStore.FileExists(resolvedFilePath))
101101
{

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override void ExecuteCmdlet()
9595

9696
if (ShouldProcess(VaultName, Properties.Resources.RestoreCertificate))
9797
{
98-
var resolvedFilePath = this.GetUnresolvedProviderPathFromPSPath(InputFile);
98+
var resolvedFilePath = this.ResolveUserPath(InputFile);
9999

100100
if (!AzureSession.Instance.DataStore.FileExists(resolvedFilePath))
101101
{

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public override void ExecuteCmdlet()
104104

105105
private string ResolveKeyVaultPath(string filePath)
106106
{
107-
FileInfo keyFile = new FileInfo(this.ResolvePath(filePath));
107+
FileInfo keyFile = new FileInfo(this.ResolveUserPath(filePath));
108108
if (!keyFile.Exists)
109109
{
110110
throw new FileNotFoundException(string.Format(Resources.BackupKeyFileNotFound, filePath));

src/ResourceManager/KeyVault/Commands.KeyVault/Commands/RestoreAzureKeyVaultSecret.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public override void ExecuteCmdlet( )
9595

9696
if (ShouldProcess(VaultName, Properties.Resources.RestoreSecret))
9797
{
98-
var resolvedFilePath = this.GetUnresolvedProviderPathFromPSPath(InputFile);
98+
var resolvedFilePath = this.ResolveUserPath(InputFile);
9999

100100
if (!AzureSession.Instance.DataStore.FileExists(resolvedFilePath))
101101
{

src/ResourceManager/Profile/Commands.Profile/Context/ImportAzureRMContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override void ExecuteCmdlet()
5151
bool executionComplete = false;
5252
if (MyInvocation.BoundParameters.ContainsKey("Path"))
5353
{
54-
Path = ResolvePath(Path);
54+
Path = this.ResolveUserPath(Path);
5555
ConfirmAction(string.Format(Resources.ProcessImportContextFromFile, Path), Resources.ImportContextTarget, () =>
5656
{
5757
if (!AzureSession.Instance.DataStore.FileExists(Path))

src/ResourceManager/Profile/Commands.Profile/Context/SaveAzureRMContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class SaveAzureRMContextCommand : AzureRMCmdlet
4242

4343
public override void ExecuteCmdlet()
4444
{
45-
Path = ResolvePath(Path);
45+
Path = this.ResolveUserPath(Path);
4646
if (Profile != null)
4747
{
4848
if (ShouldProcess(string.Format(Resources.ProfileArgumentWrite, Path),

src/ResourceManager/RecoveryServices.SiteRecovery/Commands.RecoveryServices.SiteRecovery/RecoveryPlan/GetAzureRmRecoveryServicesAsrRecoveryPlan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private void GetRecoveryPlanFile(
188188
System.IO.Path.GetDirectoryName(this.Path)));
189189
}
190190

191-
var fullFileName = this.Path;
191+
var fullFileName = ResolveUserPath(this.Path);
192192
using (var file = new StreamWriter(
193193
fullFileName,
194194
false))

src/ResourceManager/RecoveryServices.SiteRecovery/Commands.RecoveryServices.SiteRecovery/RecoveryPlan/NewAzureRmRecoveryServicesAsrRecoveryPlan.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,18 @@ public override void ExecuteSiteRecoveryCmdlet()
152152
break;
153153
case ASRParameterSets.ByRPFile:
154154

155-
if (!File.Exists(this.Path))
155+
var filePath = ResolveUserPath(this.Path);
156+
157+
if (!File.Exists(filePath))
156158
{
157159
throw new FileNotFoundException(
158160
string.Format(
159161
Resources.FileNotFound,
160-
this.Path));
162+
filePath));
161163

162164
;
163165
}
164166

165-
var filePath = this.Path;
166-
167167
using (var file = new StreamReader(filePath))
168168
{
169169
this.recoveryPlan = JsonConvert.DeserializeObject<RecoveryPlan>(

src/ResourceManager/RecoveryServices.SiteRecovery/Commands.RecoveryServices.SiteRecovery/RecoveryPlan/UpdateAzureRmRecoveryServicesAsrRecoveryPlan.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ public override void ExecuteSiteRecoveryCmdlet()
6868
break;
6969
case ASRParameterSets.ByRPFile:
7070

71-
if (!File.Exists(this.Path))
71+
var filePath = ResolveUserPath(this.Path);
72+
73+
if (!File.Exists(filePath))
7274
{
7375
throw new FileNotFoundException(
7476
string.Format(
7577
Resources.FileNotFound,
76-
this.Path));
78+
filePath));
7779
;
7880
}
7981

80-
var filePath = this.Path;
81-
8282
RecoveryPlan recoveryPlan = null;
8383

8484
using (var file = new StreamReader(filePath))

src/ResourceManager/RecoveryServices.SiteRecovery/Commands.RecoveryServices.SiteRecovery/Vault/ImportAzureRmRecoveryServicesAsrVaultSettingsFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override void ExecuteSiteRecoveryCmdlet()
5252
{
5353
base.ExecuteSiteRecoveryCmdlet();
5454

55-
Path = this.ResolvePath(Path);
55+
Path = this.ResolveUserPath(Path);
5656

5757
if (this.ShouldProcess(
5858
"Vault Setting file",

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup/Cmdlets/RecoveryPoint/GetAzureRmRecoveryServicesBackupRPMountScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public override void ExecuteCmdlet()
6161
{ VaultParams.VaultName, vaultName },
6262
{ VaultParams.ResourceGroupName, resourceGroupName },
6363
{ RestoreBackupItemParams.RecoveryPoint, RecoveryPoint },
64-
{ RecoveryPointParams.FileDownloadLocation, Path }
64+
{ RecoveryPointParams.FileDownloadLocation, ResolveUserPath(Path) }
6565
}, ServiceClientAdapter);
6666

6767
IPsBackupProvider psBackupProvider = providerManager.GetProviderInstance(

src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Vault/GetAzureRMRecoveryServicesVaultSettingsFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private void GetSiteRecoveryCredentials()
169169
string fileName = this.GenerateFileName();
170170

171171
string filePath = string.IsNullOrEmpty(this.Path) ? Utilities.GetDefaultPath() : this.Path;
172-
filePath = ResolvePath(filePath);
172+
filePath = ResolveUserPath(filePath);
173173

174174
// Generate file.
175175
if (RecoveryServicesClient.getVaultAuthType(this.Vault.ResourceGroupName, this.Vault.Name) == 0)
@@ -263,7 +263,7 @@ private string GenerateFileName()
263263
public void GetAzureRMRecoveryServicesVaultBackupCredentials()
264264
{
265265
string targetLocation = string.IsNullOrEmpty(this.Path) ? Utilities.GetDefaultPath() : this.Path;
266-
targetLocation = ResolvePath(targetLocation);
266+
targetLocation = ResolveUserPath(targetLocation);
267267
if (!Directory.Exists(targetLocation))
268268
{
269269
throw new ArgumentException(Resources.VaultCredPathException);

src/Storage/Commands.Storage/Blob/Cmdlet/SetAzureStorageBlobContent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ protected override void OnTaskSuccessful(DataMovementUserData data)
491491
/// </summary>
492492
public override void ExecuteCmdlet()
493493
{
494+
FileName = ResolveUserPath(FileName);
494495
ValidateBlobTier(string.Equals(blobType, PageBlobType, StringComparison.InvariantCultureIgnoreCase)? StorageBlob.BlobType.PageBlob : StorageBlob.BlobType.Unspecified,
495496
pageBlobTier);
496497

Binary file not shown.

0 commit comments

Comments
 (0)