Unhiding a powershell window that's been run with -WindowStyle Hidden?

Viewed 3232
2 Answers

You can always change the window style of the current window by creating a new PowerShell session and using the -WindowStyle switch:

PowerShell -Command {exit} -WindowStyle Hidden # Hide the window

Start-Sleep 1 # Do something while hidden

PowerShell -Command {exit} -WindowStyle Normal # Unhide the window

This also works if you have e.g. a monitoring script, which was started hidden and is only meant to show up once a condition was met.

Related