I find that if I start a process by start-process in powershell , the new window will be closed automatically after execution complete , is it possible to keep it waiting for my further command to close?
3 Answers
I've managed to get what I need (open powershell as administrator in a specific location), assembling this way:
Start-Process powershell -ArgumentList "-noexit -command ""& {Set-Location D:\YourPath}""" -Verb runAs
exit
Start-process: will start powershell with Args, to not exit and open at a specific location and will call administrative privileges. Exit> this will exit the first window that will open.