有人可以帮助在同一窗口中运行新进程吗?
$credential = Get-Credential
Start-Process powershell.exe -Credential $credential -NoNewWindow -ArgumentList ".\ListScript.ps1" -Wait
Write-Host "Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
-NoNewWindow 不起作用,但没有 -Credential $credential 它可以正常工作。我该如何解决?