Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 342
Gennaro Arguzzi Avatar asked Jul 11 '26 10:07

Gennaro Arguzzi


1 Answers

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

like image 132
Fabian Hofstetter Avatar answered Jul 13 '26 21:07

Fabian Hofstetter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!