When I execute .\flyway.cmd from a PowerShell, it behaves as I'd expect - output stays in powershell. However, when I run c:\temp\flyway\flyway.cmd (absolute path), it pops open a cmd window instead. Why?
Additional info: Inspired by the question of "What's in the CMD script?" from andyb, I started playing around with different scripts. I eventually found that I can make an exact copy of the current cmd file and that copy runs as expected. This means there's something about the file attributes that is making it do this. It was originally a "blocked" file which I had to unblock in it's properties (windows often does this with files that were downloaded). But it isn't any longer. I can also make it run consistently by running the whole command with cmd /c, but that still doesn't explain what is different.
powershell.exe -NoProfile)