Runs a process as an administrator. If $exeToRun is not specified, it is run with PowerShell.
NOTE: This command will assert UAC/Admin privileges on the machine.
Start-ChocolateyProcessAsAdmin $statements $exeToRunStart-ChocolateyProcessAsAdmin "$msiArgs" 'msiexec'
Start-ChocolateyProcessAsAdmin "$silentArgs" $file
Start-ChocolateyProcessAsAdmin "$silentArgs" $file -validExitCodes @(0,21)$psFile = Join-Path "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 'someInstall.ps1'
Start-ChocolateyProcessAsAdmin "& `'$psFile`'"-
-statementsThese are statements and/or arguments for an application.
Example:
'/i package /q' -
-exeToRunThis is the executable/application to run.
Example:
cmd.exeDefaults to
powershell -
-validExitCodes(optional)If there are other valid exit codes besides zero signifying a successful install, please pass
-validExitCodeswith the value, including 0 as long as it is still valid.Example:
-validExitCodes @(0,44)Defaults to
@(0).
[[Function Reference|HelpersReference]]