Skip to content
mnaoumov.dev
Go back

sudo in PowerShell

Grabbed here

function Elevate-Process
{
    $file, [string]$arguments = $args;
    $psi = New-Object System.Diagnostics.ProcessStartInfo $file;
    $psi.Arguments = $arguments;
    $psi.Verb = "runas";
    $psi.WorkingDirectory = Get-Location;
    [System.Diagnostics.Process]::Start($psi);
}

Set-Alias sudo Elevate-Process;

Share this post on:

Previous Post
IE7 and browser resize issues
Next Post
MSBuild and .sln files