Sending multiple arguments to a Powershell opened with Start-Process

Question:

So I’m using the command

where $cmds is

I just want the new powershell that I’m opening to run multiple commands before it automatically closes.

Answer:

Change $cmds to:

$cmds = {"cd C:\"; "dir";}

Source:

Sending multiple arguments to a Powershell opened with Start-Process by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply