michel vaillancourt
michel vaillancourt

Reputation: 59

Open new powershell console and run a command

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.

Upvotes: 5

Views: 9443

Answers (1)

tmfahall
tmfahall

Reputation: 182

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.

Upvotes: 7

Related Questions