我有一个AWS CLI命令可以从我的S3存储桶下载一些文件,但是我想从PowerShell变量中传递参数及其值。这可能吗?
这有效:
$filterInclude = "7012*"
$results = aws s3 cp $bucketPath $destinationDir --recursive --exclude $filterExclude --include $filterInclude
但是我想要类似的东西:
$filterInclude = "7012*"
$includeCom = "--include \`"$($filterInclude)\`""
$results = aws s3 cp $bucketPath $destinationDir --recursive --exclude $filterExclude "$($includeCom)"
我得到的结果是: 未知选项:--include“ 7012 *”