I couldn’t find a complete example using powershell, but this should work.
https://travis-ci.org/mischnic/screenshot-tester/jobs/465320714:
$ if [ "$TRAVIS_OS_NAME" == "windows" ]; then powershell -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/f8bb8306668fcdea9370b25021eafb623e213210/scripts/set-screenresolution.ps1')) & Set-ScreenResolution 1920 1080"; fi
The command "if [ "$TRAVIS_OS_NAME" == "windows" ]; then powershell -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/f8bb8306668fcdea9370b25021eafb623e213210/scripts/set-screenresolution.ps1')) & Set-ScreenResolution 1920 1080"; fi" failed and exited with 126 during .
Your build has been stopped.
/c/Users/travis/.travis/job_stages: line 104: /c/Windows/System32/WindowsPowerShell/v1.0/powershell: Permission denied
powershell -Command "...."
works locally