【发布时间】:2017-04-05 06:00:56
【问题描述】:
虽然我不是 powershell 脚本大师,但我很难将一些压缩文件上传到我的 Azure 文件存储。
我已经尝试过以下脚本 微软指南(“https://docs.microsoft.com/sv-se/powershell/module/azure.storage/set-azurestoragefilecontent?view=azurermps-1.2.9”)
$StorageAccountName = "MyAccountName"
$StorageAccountKey = "TheKeyThat I have"
$ctx = New-AzureStorageContext -StorageAccountName $StorageAccountName `
-StorageAccountKey $StorageAccountKey
Set-AzureStorageFileContent archive archive\Test\ C:\Users\User\Desktop\MoveFrom\*.* -Context $context'
我遇到的问题是这个错误
Set-AzureStorageFileContent : The specified source file 'archive\Test\' was not found.
At line:5 char:10
+ Set-AzureStorageFileContent archive archive\Test\ C:\Users\User\De ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureStorageFileContent], FileNotFoundException
+ FullyQualifiedErrorId : FileNotFoundException,Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet.SetAzureStorageFileContent
共享名为存档,在存档中我们有不同的文件夹,其中一个文件夹名为 Test。所以我不明白为什么它抱怨源文件丢失?
【问题讨论】:
标签: file powershell azure storage powershell-cmdlet