Assert‑SqlDscAgentOperator - dsccommunity/SqlServerDsc GitHub Wiki
Asserts that a SQL Server Agent Operator exists and throws a terminating error if not found.
Assert-SqlDscAgentOperator [-ServerObject] <Server> [-Name] <String>
[<CommonParameters>]
This command asserts that a SQL Server Agent Operator exists using the provided parameters. If the operator is not found, it throws a terminating error with a generic localized error message.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Assert-SqlDscAgentOperator -Name 'TestOperator'
Asserts that the SQL Agent Operator 'TestOperator' exists, throws error if not found.
Assert-SqlDscAgentOperator -ServerObject $serverObject -Name 'TestOperator'
Asserts that the SQL Agent Operator 'TestOperator' exists, throws error if not found.
Specifies the name of the operator to check for.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the server object on which to check for the operator.
Type: Server
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.