New-AzActivityLogAlertCondition

Creates an new activity log alert condition object in memory.

Syntax

New-AzActivityLogAlertCondition
   -Field <String>
   -Equal <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzActivityLogAlertCondition cmdlet creates new activity log alert condition object in memory.

Examples

Example 1: Create a new activity log alert condition object in memory.

PS C:\>$Condition = New-AzActivityLogAlertCondition -Field "Requests" -Equal "OtherField"
PS C:\>Write-Host "Field property value: $($Condition.Field)"
PS C:\>Write-Host "Equals property value: $($Condition.Equals)"

Field property value: Requests
Equals property value: OtherField

This command creates a new activity log alert condition object in memory. NOTE: when this cmdlet is used with Set-AzActivityLogAlert at least one of these objects, passed as parameters, must have its Field equal to "Category". Otherwise, the backend responds with a 400 (BadRequest.)

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Equal

Specifies the equals property for the leaf condition.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Field

Specifies the field for the condition.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Outputs

Microsoft.Azure.Management.Monitor.Management.Models.ActivityLogAlertLeafCondition