AWS Run Command act different than running on server locally

房东的猫 提交于 2019-12-02 13:33:17

I think there is a mess up with quotes and the way how they're escaped.

See: How to escape a double quote inside double quotes?

This version should look much simpler:

CMD='$fileEXE = "C:\Program Files (x86)\NUnit\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe";'
CMD+='$testDll = "C:\TestFramework\TestFramework\Tests\bin\Debug\TESTS.dll";'
CMD+='[System.Diagnostics.Process]::Start($fileEXE,$testDll);'

aws ssm send-command --document-name "AWS-RunPowerShellScript" \
  --filters "Name=tag:Name,Values=Auto-Scaling-Group" \
  --comment "Run Test UI Testing" --timeout-seconds 600 --region us-east-1 \
  --parameters commands="'$CMD'"

Note: Run it in the Bash shell.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!