gpt4 book ai didi

azure - 由于源文件夹,AZCopy 返回错误

转载 作者:行者123 更新时间:2023-12-03 01:38:19 24 4
gpt4 key购买 nike

我有以下 PowerShell 脚本将文件夹内容复制到 Azure 存储容器。

我正在尝试使其正常工作,但我不断收到错误消息:

[2019/05/13 17:32:31][ERROR] The syntax of the command is incorrect. Error parsing the argument "C:\temp": parameter name is required.

有人能看出我做错了什么吗?

$azPath = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy"
Set-Location $azPath

$StorageAccountName = "#"
$StorageAccountKey = "#"
$ContainerName = "#"

$SourceFolder = "C:\temp"
$DestURL = "https://$StorageAccountName.blob.core.windows.net/$ContainerName"
$Result = .\AzCopy.exe $SourceFolder $DestURL /BlobType:block /destkey:$StorageAccountKey /Y
$Result

最佳答案

您可以添加参数 /source/dest,这应该是 $Result = .\AzCopy.exe/source:$SourceFolder/dest:$ DestURL/BlobType:block/destkey:$StorageAccountKey/Y

enter image description here

关于azure - 由于源文件夹,AZCopy 返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56107688/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com