Assert-Command¶
SYNOPSIS¶
Ensures the given command exists and is available to the current PowerShell session
SYNTAX¶
DESCRIPTION¶
Ensures the given command exists and is available to the current PowerShell session
EXAMPLES¶
Example 1: Command that is present¶
This command would pass successfully as the command exists
Example 2: Command that is not present¶
This command would return a terminating error as the command doesn't exist
Example 3: Check multiple commands¶
This command would return a terminating error as one of the commands does not exist
PARAMETERS¶
-Command¶
The command(s) to be checked
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters¶
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.