You can run cmd.exe or PowerShell commands by sticking them in .bat or .ps1 scripts and calling those from the Travis script, as long as you don’t mind the scripts running as a single job step.
For cmd.exe stuff: Put your commands in a .bat script file and call the .bat file as a command from the main script. Git bash is smart enough to run that under cmd.exe.
script:
- my_cmd_script.bat
For PowerShell, you need to enable script execution, and then you can call .ps scripts with PowerShell -File <file>.
You can also run single PowerShell commands using PowerShell -Command <command> from the script. You will probably need to put <command> in single quotes to get bash escaping right.
I think calling powershell without any arguments will fire up an interactive PowerShell session, which is why your build hangs.
I’d suggest writing your scripts in PowerShell instead of .bat files, even if you’re not familiar with it, because .bat is the worst scripting language ever invented.
I’d suggest writing your scripts in PowerShell instead of .bat files, even if you’re not familiar with it, because .bat is the worst scripting language ever invented.
LOL.
Anyway, reason I asked is because I thought, based on the docs, that Powershell support was somehow able to be invoked directly from .travis.yml, but clearly, at least now, one can’t select or trigger PowerShell context (or cmd.exe) for travis.yml.