所以我使用命令
Start-Process powershell -Verb runas -ArgumentList $cmds
其中$cmd为
$cmds = "cd C:", "dir"
我只是想让我打开的新powershell在自动关闭之前运行多个命令。
将$cmds
改为:
$cmds = {"cd C:"; "dir";}