Gennaro Arguzzi
Gennaro Arguzzi

Reputation: 857

PowerShell script to open a new PowerShell window and run command

I'm looking for a way to write a script which is able to open a new PowerShell window and to run command. E.g. I'd like to launch PowerShell, in this window I need to run a script able to open a new PowerShell window inside which the command pwd is executed.

Upvotes: 3

Views: 9278

Answers (1)

Fabian Hofstetter
Fabian Hofstetter

Reputation: 128

Try on of this Commands

Start-Process powershell.exe -ArgumentList "-noexit"  



 Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{Get-Location}"

to start the Window maximized us the Parameter -WindowStyle Maximized

Provide more Code for further Information

Upvotes: 10

Related Questions