向使用 Start-Process 打开的 Powershell 发送多个参数

Tre*_*vor 4 powershell

所以我使用命令

Start-Process powershell -Verb runas -ArgumentList $cmds
Run Code Online (Sandbox Code Playgroud)

$cmds 在哪里

$cmds = "cd C:\", "dir"
Run Code Online (Sandbox Code Playgroud)

我只希望我打开的新 powershell 在它自动关闭之前运行多个命令。

Dav*_*vic 7

更改$cmds为:

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