繁体   English   中英

Azure Runbook Powershell将zip文件从Blob容器移动到FileShare并在目标位置将其解压缩

[英]Azure Runbook Powershell move zip file from Blob Container to FileShare and Unzip the file once in destination

我正在尝试将zip文件从Azure Blob容器移动到Azure fileShare。 我想添加选项以在目标端解压缩文件。 我在自动化Runbook中使用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

}

我认为您将无法在存储文件共享中解压缩文件,可以在其中放置压缩的内容,但是不能使Storage Service解压缩它。 解决方法是先下载文件,然后解压缩。

这是一个类似的问题,您可以参考

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM