Question:
I would like to add a line to my script that open a new power shell console and run a ping command in the new window.
Answer:
1 2 |
start-process powershell.exe -argument '-nologo -noprofile -executionpolicy bypass -command Test-Connection ipAddressToPing; read-host "press enter"' |
You can add the ip address to the script or leave it out and it will ask you for it at runtime. You can remove the read-host “press enter”‘ if you want the window to close right away.