将参数放入 AWS cli 会导致“未知选项”

问题描述 投票:0回答:1

我从中收到错误未知选项:

$test = "s3",  "ls",  "s3://mybucket", '--region us-east-2'
aws @test

未知选项:--region us-east-2

powershell aws-cli parameter-splatting
1个回答
0
投票

问题是带有值的参数需要被分解:
'--region us-east-2' 到 '--region', 'us-east-2'

$test = "s3",  "ls",  "s3://mybucket", '--region', 'us-east-2'
aws @test
© www.soinside.com 2019 - 2024. All rights reserved.