I am using the remote-exec provider in my terraform v0.9.11 template like this:
...
provisioner "remote-exec" {
inline = [
"Set-ExecutionPolicy Bypass -force",
"./C:\ProgramData\Amazon\EC2-Windows\Launch\Config\Replace-FileString.ps1 -Pattern '""' -Replacement '"${var.admin_password}"' -Path LauchConfig.json"
]
...
But I get an illegal char escape
error at -Pattern '""'
.
The command I want to execute on the remote machine is: "... FileString.ps1 -Pattern '""' -Replacement '"xyz"' "
PS: escaping with \ like
"... FileString.ps1 -Pattern '\"\"' -Replacement '\"xyz\"' "
does not work either.
...
represents omitted irrelevant text here.