【问题标题】:Azure Runbook Powershell move zip file from Blob Container to FileShare and Unzip the file once in destinationAzure Runbook Powershell 将 zip 文件从 Blob 容器移动到 FileShare 并在目标位置解压缩文件一次
【发布时间】:2019-04-08 09:03:55
【问题描述】:

我正在尝试将 zip 文件从 Azure Blob 容器移动到 Azure 文件共享。我想添加在目标端解压缩文件的选项。我在自动化运行手册中使用 Powershell。以下是我的功能的片段。我无法弄清楚所有活动都在存储帐户中发生的 Expand-Archive cmdlet(没有本地路径 c:\ 等)

            if ($blob.name.StartsWith($blobMatch)) {
                $destFile
                $blobName = $blob.name
                #Get-AzureStorageFileContent
                #Expand-Archive -Path $blob -DestinationPath $destFile
                Start-AzureStorageFileCopy `
                    -SrcBlobName $blob.name `
                    -SrcContainerName $sourceContainer `
                    -DestShareName $destinationShare `
                    -DestFilePath $destFile `
                    -Context $ctx `
                    -DestContext $ctx `
                    -Force

}

【问题讨论】:

  • 这个问题有更新吗?如果我的回复有帮助,请标记为答案。

标签: azure powershell zip archive expand


【解决方案1】:

我认为您将无法解压缩存储文件共享中的文件,您可以将压缩内容放在那里,但您不能让存储服务解压缩它。解决方法是先下载文件,然后解压缩。

这里有一个类似的问题,你可以参考it。

【讨论】:

    猜你喜欢
    • 2021-03-03
    • 2019-08-09
    • 2020-05-02
    • 2016-04-20
    • 2020-12-16
    • 2018-11-15
    • 2016-11-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多