Get-AlertRule
Applies To: Azure PowerShell 1.0
Get-AlertRule
Gets alert rules.
Syntax
Parameter Set: Parameters for GetAlert cmdlet
Get-AlertRule -ResourceGroup <String> [-DetailedOutput] [ <CommonParameters>]
Parameter Set: Parameters for GetAlert cmdlet using name
Get-AlertRule -Name <String> -ResourceGroup <String> [-DetailedOutput] [ <CommonParameters>]
Parameter Set: Parameters for GetAlert cmdlet using target resource uri
Get-AlertRule -ResourceGroup <String> -TargetResourceId <String> [-DetailedOutput] [ <CommonParameters>]
Detailed Description
The Get-AlertRule cmdlet gets alert rules, by using either a resource group or its name or URI.
Parameters
-DetailedOutput
Indicates that this cmdlet displays full details in the output.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the alert rule.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-ResourceGroup<String>
Specifies the name of the resource group.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-TargetResourceId<String>
Specifies the ID of the target resource.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get alert rules for a resource group
This command gets all the alert rules for a resource group. The output does not contain details about the rules.
PS C:\> Get-AlertRule -ResourceGroup "Contoso-Web-CentralUS"
Example 2: Get an alert rule by name
This command gets a single alert rule identified by its name and resource group. The output contains only basic information about the alert rule.
PS C:\> Get-AlertRule -ResourceGroup "Contoso-Web-CentralUS" -Name "MyAlert-7da64548-214d-42ca-b12b-b245bb8f0ac8"
Example 3: Get an alert rule by name and provide its details
This command gets a specified rule by name and resource group name. The output provides details about the rule.
PS C:\> Get-AlertRule -ResourceGroup "Default-Web-CentralUS" -Name "MyAlert-7da64548-214d-42ca-b12b-b245bb8f0ac8" -DetailedOutput