public DownloadFileToBlob ( Microsoft.Azure.Commands.DataFactories.BlobDownloadParameters parameters ) : void | ||
parameters | Microsoft.Azure.Commands.DataFactories.BlobDownloadParameters | |
return | void |
public override void ExecuteCmdlet() { if (ParameterSetName == ByFactoryObject) { if (DataFactory == null) { throw new PSArgumentNullException(string.Format(CultureInfo.InvariantCulture, Resources.DataFactoryArgumentInvalid)); } DataFactoryName = DataFactory.DataFactoryName; ResourceGroupName = DataFactory.ResourceGroupName; } PSRunLogInfo runLog = DataFactoryClient.GetDataSliceRunLogsSharedAccessSignature( ResourceGroupName, DataFactoryName, Id); if (DownloadLogs.IsPresent) { string directory = string.IsNullOrWhiteSpace(Output) ? Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) : Output; if (!HaveWriteAccess(directory)) { throw new IOException(string.Format(CultureInfo.InvariantCulture, Resources.NoWriteAccessToDirectory, directory)); } try { DataFactoryClient.DownloadFileToBlob(new BlobDownloadParameters() { Directory = directory, SasUri = new Uri(runLog.SasUri), Credentials = new StorageCredentials(runLog.SasToken) }); } catch { throw new Exception(string.Format(CultureInfo.InvariantCulture, Resources.DownloadFailed, directory)); } WriteWarning(string.Format(CultureInfo.InvariantCulture, Resources.DownloadLogCompleted, directory)); } WriteObject(runLog); }