As described in the subject, my powershell environment is executing all external commands in separate windows. In a typical test run of my team's build script, this includes things like:

  • nuget.exe running for each project in a sln
  • nunit test runners

It's quite aggravating. The behavior actually prevents me from multi-tasking while running psake builds, since it grabs my mouse/keyboard focus whenever a new window appears/disapears. It also swallows valuable output from assorted steps in our build process.

As per https://stackoverflow.com/questions/8181490/powershell-suddenly-opens-cmd-exe-for-executing-bats, I checked $env:PATHEXT, but it is set up correctly (includes .EXE in its items, which are a semicolon-delimited list).

I am the only member of the team seeing this behavior, and it appears to be associated with some global/roaming profile for my user, as it is still happening even after I re-imaged my machine.

Any help would be greatly appreciated and I can provide additional info upon request.

  • Could you please include a sample script that demonstrates the problem you're experiencing? It's important to see exactly how you're calling cmdlets and the params you're using. – Colyn1337 Apr 28 '14 at 14:18

How are the scripts written? My first reaction would be to use Start-Process with the -NoNewWindiw parameter.


I experienced the same problem, and after a while found out that if the current working directory is deleted, you get this behavior: The commands are run in a separate command window. So: Make sure that the working directory exists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.