< Back

Invoke-AsAdmin

Sat Jan 18, 2020 10:17 pm

NAME Invoke-AsAdmin



SYNOPSIS

Start the given program as administrator (elevated)

If the current process is elevated, just executes the command (using "start-process")





SYNTAX

Invoke-AsAdmin [[-ArgumentList] <Object>] [[-proc] <Object>] [-Wait] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-ArgumentList <Object>

Argument list for the started program



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-proc <Object>

The program to start (default=powershell)



Required? false

Position? 2

Default value powershell

Accept pipeline input? false

Accept wildcard characters? false



-Wait [<SwitchParameter>]

Wait for the elevated command to finish before continuing (default=true)



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS





RELATED LINKS