gpt4 book ai didi

powershell - 错误解析参数 '--change-batch' : Expected: '=' , received: ' ' for input:

转载 作者:行者123 更新时间:2023-12-01 21:23:27 28 4
gpt4 key购买 nike

我想更新 CNAME 记录。我收到 Error parsing parameter '--change-batch': Expected: '=', received: ' ' for input: 当我运行下面的 powershell 脚本时。我在 here 中看到类似的错误对于另一个 aws 命令。我确认我正在按照那里的建议使用 file:// 。我还看到另一个post并且我确认我没有前面或后面的双引号或单引号。我能够验证 json 数据并确保该文件存在于同一目录中。我不知道发生了什么事。任何帮助表示赞赏。我的 powershell 脚本如下。

$json = '{"Changes": [{"Action": "UPSERT","ResourceRecordSet": {"Name": "dev.mydns.com","Type": "CNAME","TTL": 300,"ResourceRecords": [{"Value": "s-########1.server.transfer.us-east-1.amazonaws.com."}]}},{"Action": "UPSERT","ResourceRecordSet": {"Name": "qa.mydns.com","Type": "CNAME","TTL": 300,"ResourceRecords": [{"Value": "s-########2.server.transfer.us-east-1.amazonaws.com"}]}},{"Action": "UPSERT","ResourceRecordSet": {"Name": "uat.mydns.com","Type": "CNAME","TTL": 300,"ResourceRecords": [{"Value": "s-########3.server.transfer.us-east-1.amazonaws.com."}]}}]}'
$json | Out-File "route_update.json"

#I was able to get the file content and print using below commands

<#
$jsondata = Get-Content -Raw -Path route_update.json
Write-Host $jsondata
#>

aws route53 change-resource-record-sets --hosted-zone-id <ZoneId> --change-batch file://route_update.json

最佳答案

如果要使用JSON文件,相对路径(macOS/Linux)的格式为;

--change-batch file://./dnsUpdates.json

关于powershell - 错误解析参数 '--change-batch' : Expected: '=' , received: ' ' for input:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63493865/

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