Hi,
The command Get-NetFirewallRule requires elevation and short of opening up a separate elevated pwsh session, I’m trying to use Start-Process to run the command:
Start-Process pwsh.exe -WindowStyle Maximized -Verb Runas -ArgumentList '-Command "& {Get-NetFirewallRule -DisplayName "*Event*Log*" | Select-Object DisplayName,Name,Profile,Enabled}"'
Main issue is the new pwsh window that it spawns closes once the output is shown. I’ve tried adding a Read-Host to pause the window but its just a blank window and when I hit Enter, the output is shown and the window closes immediately. Is there any way I can get the output to be shown without the window closing immediately?
Secondary issue is the new window that it spawns. The parameter -NoNewWindow does not work with -Verb. Not a biggie but is there any way to have the output in the same session window?
Thanks.