【发布时间】:2022-06-10 21:40:18
【问题描述】:
在 Terraform 中执行 Azure VM 扩展以运行 Powershell 脚本时出现以下错误。你能帮我解决这个错误吗?
命令执行完成,但失败,因为它返回了一个非零退出代码:“1”。该命令有一个错误输出:'命令行太长。 '
这是我使用的受保护设置详细信息
"commandToExecute": "powershell -command \"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${base64encode(data.template_file.secvmtf.rendered)}')) | Out-File -filepath hybrid.ps1\" && powershell -ExecutionPolicy Unrestricted -File hybrid.ps1"
【问题讨论】:
-
您使用的是哪个版本的 PowerShell?
标签: powershell terraform azure-vm