Created
August 5, 2018 23:55
-
-
Save mardahl/b5d07fd3f039e1877b7033b3ac7f0e0c to your computer and use it in GitHub Desktop.
Example of a SUDO function for powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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