< Back
Assert-CAdminPrivilege
Post
NAME Assert-CAdminPrivilege
SYNOPSIS
Writes an error and returns false if the user doesn't have administrator privileges.
SYNTAX
Assert-CAdminPrivilege [<CommonParameters>]
DESCRIPTION
Many scripts and functions require the user to be running as an administrator. This function checks if the user
is running as an administrator or with administrator privileges and writes an error if the user doesn't.
PARAMETERS
<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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-CAdminPrivilege
Writes an error that the user doesn't have administrator privileges.
RELATED LINKS
Test-CAdminPrivilege
SYNOPSIS
Writes an error and returns false if the user doesn't have administrator privileges.
SYNTAX
Assert-CAdminPrivilege [<CommonParameters>]
DESCRIPTION
Many scripts and functions require the user to be running as an administrator. This function checks if the user
is running as an administrator or with administrator privileges and writes an error if the user doesn't.
PARAMETERS
<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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-CAdminPrivilege
Writes an error that the user doesn't have administrator privileges.
RELATED LINKS
Test-CAdminPrivilege