Functions/Authentication/Enter-AdminContext.ps1
function Enter-AdminContext { IF(!(Get-AdminContext)) { $AdminPoSH = New-Object System.Diagnostics.ProcessStartInfo "Powershell"; $AdminPoSH.Arguments = $MyInvocation.MyCommand.Definition; $AdminPoSH.Verb = "runas"; [System.Diagnostics.Process]::Start($AdminPoSH); exit } } |