Run a Command Elevated with Start-Process -Verb RunAs

Trigger the UAC prompt and launch an admin-level process from a non-elevated PowerShell session.

WindowsadminuacpowershellMedium risk
Run Start-Process powershell -Verb RunAs -ArgumentList '-Command', '<command>' to execute a command in an elevated window.

01Command

Command
$ Start-Process powershell -Verb RunAs -ArgumentList '-Command', 'Get-EventLog System -Newest 5'

02What it does

A non-admin PowerShell cannot simply 'sudo' into another command — Start-Process -Verb RunAs is the built-in way to request elevation, spawning a new process under the UAC prompt. The elevated process runs in its own window and its output is not returned to the caller, so capture results with -RedirectStandardOutput or have the child write to a file. -Wait makes the script block until the elevated process exits, which is what you want when the following lines depend on it.

03Risk

RiskMedium risk
!Warning: Anything passed via -ArgumentList runs with admin rights and without your session's variable context — avoid interpolating untrusted input into the command string.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Start-Process - SS64
    SS64 · technical · 2026-09-17
    Evidence: Shows -Verb RunAs examples and notes that output of the elevated process is not captured.
  • Start-Process
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents the -Verb RunAs parameter for UAC elevation.

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions