Does Not work: Execute-Process -WindowStyle Hidden

Execute-Process -Path “$envWinDir\Notepad.exe” -WindowStyle Hidden

The above command does not hide the Notepad window. I have a process (application) I need to start silently. However, I want the entire PSADT to be interactive to the user.

Thanks,
b0n3z

For those curious - Maximized and Minimized also do not work as designed.

-b0n3z

Just an FYI - this DOES work… So I guess this cmdlet Execute-Process is broke or how it translates information to Start-Process.

Working:
Start-Process -FilePath “$env:windir\Notepad.exe” -WindowStyle Hidden

Fails:
Execute-Process -Path “$envWinDir\Notepad.exe” -WindowStyle Hidden

-b0n3z

Thanks for the bug report, however next time please create an Issue on our Github page:

Also, remember that hiding the window through windowstyle doesn’t make the program stop automatically, its just not visible and can block your script until a button is closed even though its not visible.