Basically I wanted to do this but I’ve tried many escape symbols but just can’t get this right:
provisioner “powershell” {
inline = [
“& ‘C:\Program Files\Amazon\EC2Launch\EC2Launch.exe’ reset -b -c”,
]
}
The powershell command is between these double quotes " & ‘C:\Program Files\Amazon\EC2Launch\EC2Launch.exe’ reset -b -c "
Doing “&” 'C:\Program Files\Amazon\EC2Launch\EC2Launch.exe
’ reset -b -c results in:
==> amazon-ebs.builder-source-1: + “&”
'C:\Program Files\Amazon\EC2Launch\EC2Launch.exe
’ reset -b -c
==> amazon-ebs.builder-source-1: + ~~~~~~~~~~~~
==> amazon-ebs.builder-source-1: Unexpected token '`‘C:\Program’ in expression or statement.
==> amazon-ebs.builder-source-1: + CategoryInfo : ParserError: (, ParseException
==> amazon-ebs.builder-source-1: + FullyQualifiedErrorId : UnexpectedToken
Anyone could help me get the escaping correct?
I’m putting it inline and not script for obvious reason (pun intended) since it’s just 1 liner