Running a command as Administrator using PowerShell?

后端 未结 26 3409
粉色の甜心
粉色の甜心 2020-11-22 09:41

You know how if you\'re the administrative user of a system and you can just right click say, a batch script and run it as Administrator without entering the administrator p

26条回答
  •  鱼传尺愫
    2020-11-22 10:01

    If the current console is not elevated and the operation you're trying to do requires elevated privileges then you can start powershell with the Run as Administrator option :

    PS> Start-Process powershell -Verb runAs
    

    https://docs.microsoft.com/powershell/module/Microsoft.PowerShell.Management/Start-Process

提交回复
热议问题