You can run
cmd.exe or PowerShell commands by sticking them in
.ps1 scripts and calling those from the Travis
script, as long as you don’t mind the scripts running as a single job step.
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
For PowerShell, you need to enable script execution, and then you can call
.ps scripts with
PowerShell -File <file>.
- PowerShell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned'
- PowerShell -File my_powershell_script.ps1
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.