Hi Everyone
I wrote the following PS script:
Enable-NetFirewallRule -DisplayName "Network Discovery"; exit
If you paste that code to a PS console with, run as an admin it will execute the command and exit (close the window) powershell.
When I run this script through a shortcut the window stays open and it doesn’t exit. The shortcut runs powershell.exe as admin and then the shortcut points to the location of the script with some parameters beforehand.
The behaviour is specific to the exit command. If I’m running let’s say “ipconfig” after the semicolon it runs just fine.
Any ideas?
Answers are greatly appreciated!