vmware / powerclicore

PowerCLI Core Dockerfile
Apache License 2.0
97 stars 48 forks source link

PowerCli, Docker And The Dollar Sign #18

Closed infroger closed 6 years ago

infroger commented 6 years ago

Spent few hours trying to use the dollar sign ($) in the entrypoint of a docker-compose file. Didn't find the solution on the web, only by trial and error. Would like to share.

The solution is to double escape the dollar sign (\$$).

Turn this:

entrypoint: |
  bash -c '/usr/bin/powershell <<EOF
    Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
...
 EOF'

Into this:

entrypoint: |
  bash -c '/usr/bin/powershell <<EOF
    Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:\$$false
...
 EOF'