This file contains 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 Invoke-ElevatedCommand { | |
<# | |
.DESCRIPTION | |
Invokes the provided script block in a new elevated (Administrator) powershell process, | |
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output | |
will be LOST - only the object pipeline and errors are handled. In general, prefer | |
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information. | |
Also see Community Extensions "Invoke-Elevated"/"su" | |
.EXAMPLE |