Skip to content

Instantly share code, notes, and snippets.

@mardahl
Created August 5, 2018 23:55
Show Gist options
  • Save mardahl/b5d07fd3f039e1877b7033b3ac7f0e0c to your computer and use it in GitHub Desktop.
Save mardahl/b5d07fd3f039e1877b7033b3ac7f0e0c to your computer and use it in GitHub Desktop.
Example of a SUDO function for powershell
function sudo
{
$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);
}
sudo "reg" "add HKLM\Software\Policies\Microsoft\Office$ver.0\Lync /v GalDownloadInitialDelay /t REG_DWORD /d 0 /f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment