Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Az.Monitor Syntax Errors #17694

Merged
merged 3 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Add-AzWebtestAlertRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma

### Example 1: Add a webtest alert rule
```powershell
Add-AzWebtestAlertRule -Name "webtestRule" -Location "East US" -ResourceGroup "Default-Web-EastUS" -WindowSize 00:05:00 -MetricName "metric" -TargetResourceUri "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/Default-Web-WestUS/providers/Microsoft.Insights/webtests/leowebtestr1-webtestr1" -Description "Nice Webtest rule" -Failed 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-FailedLocationCount 3

Add-AzWebtestAlertRule -Name "webtestRule" -Location "East US" -ResourceGroup "Default-Web-EastUS" -WindowSize 00:05:00 -MetricName "metric" -TargetResourceUri "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/Default-Web-WestUS/providers/Microsoft.Insights/webtests/leowebtestr1-webtestr1" -Description "Nice Webtest rule" -FailedLocationCount 3
```

```output
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Disable-AzActivityLogAlert.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This command changes the tags property of the activity log alert called alert1 a

### Example 2: Disable an activity log alert using a PSActivityLogAlertResource object as input
```powershell
$obj = Get-AzActivityLogAlert -ResourceGroup "Default-activityLogAlerts" -Name "alert1"
$obj = Get-AzActivityLogAlert -ResourceGroupName "Default-activityLogAlerts" -Name "alert1"
Disable-AzActivityLogAlert -InputObject $obj
```

Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Enable-AzActivityLogAlert.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This command enables the activity log alert called alert1 in the resource group

### Example 2: Enable an activity log alert using a PSActivityLogAlertResource object as input
```powershell
$obj = Get-AzActivityLogAlert -ResourceGroup "Default-activityLogAlerts" -Name "alert1"
$obj = Get-AzActivityLogAlert -ResourceGroupName "Default-activityLogAlerts" -Name "alert1"
Enable-AzActivityLogAlert -InputObject $obj
```

Expand Down
4 changes: 2 additions & 2 deletions src/Monitor/Monitor/help/Get-AzActionGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ This command lists all the action group for the current subscription.

### Example 2: Get action groups for the given resource group
```powershell
Get-AzActionGroup -ResourceGroup "Default-activityLogAlerts"
Get-AzActionGroup -ResourceGroupName "Default-activityLogAlerts"
```

This command lists action groups for the given resource group.

### Example 3: Get an action group.
```powershell
Get-AzActionGroup -ResourceGroup "Default-activityLogAlerts" -Name "actionGroup1"
Get-AzActionGroup -ResourceGroupName "Default-activityLogAlerts" -Name "actionGroup1"
```

This command lists one (a list with a single element) action group.
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Get-AzAutoscaleHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The **Get-AzAutoscaleHistory** cmdlet gets the history of events related to an A
## EXAMPLES

### Example 1: Get all events associated with a subscription
```
```powershell
Get-AzAutoscaleHistory -StartTime 2015-02-09T18:35:00 -EndTime 2015-02-09T18:40:00 -DetailedOutput
```

Expand Down
4 changes: 2 additions & 2 deletions src/Monitor/Monitor/help/Get-AzDataCollectionRule.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This command lists all the data collection rules for the current subscription.

### Example 2: Get data collection rules for the given resource group
```powershell
Get-AzDataCollectionRule -ResourceGroup "testgroup"
Get-AzDataCollectionRule -ResourceGroupName "testgroup"
```

```output
Expand All @@ -95,7 +95,7 @@ This command lists data collection rules for the given resource group.

### Example 3: Get a data collection rule
```powershell
Get-AzDataCollectionRule -ResourceGroup "testgroup" -RuleName "testDcr"
Get-AzDataCollectionRule -ResourceGroupName "testgroup" -RuleName "testDcr"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ This command lists all the data collection rules for the given target resource I

### Example 2: Get data collection rules associations by rule (DCR)
```powershell
Get-AzDataCollectionRuleAssociation -ResourceGroup $rg -RuleName $dcrName
Get-AzDataCollectionRuleAssociation -ResourceGroupName $rg -RuleName $dcrName
```

```output
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Get-AzMetric.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ This command gets detailed output for the Requests metric.
```powershell
$dimFilter = @((New-AzMetricFilter -Dimension City -Operator eq -Value "Seattle","Toronto"), (New-AzMetricFilter -Dimension AuthenticationType -Operator eq -Value User))

Get-AzMetric -ResourceId <resourceId> -MetricName PageViews -TimeGrain 00:05:00 -MetricFilter $dimFilter -StartTime 2018-02-01T12:00:00Z -EndTime 2018-02-01T12:10:00Z -AggregationType -Average
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-AggregationType Average

Get-AzMetric -ResourceId <resourceId> -MetricName PageViews -TimeGrain 00:05:00 -MetricFilter $dimFilter -StartTime 2018-02-01T12:00:00Z -EndTime 2018-02-01T12:10:00Z -AggregationType Average
```

```output
Expand Down
4 changes: 2 additions & 2 deletions src/Monitor/Monitor/help/New-AzAlertRuleEmail.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The **New-AzAlertRuleEmail** cmdlet creates an e-mail action for an alert rule.

### Example 1: Create an alert rule email action for service owners
```powershell
New-AzAlertRuleEmail -SendToServiceOwners
New-AzAlertRuleEmail -SendToServiceOwner
```

This command creates an alert rule email action to send for its service owners when an alert rule is fired.
Expand All @@ -39,7 +39,7 @@ This command creates an alert rule email action for the specified email addresse

### Example 3: Create an alert rule email action for service owners and non-service owners
```powershell
New-AzAlertRuleEmail -CustomEmail [email protected] -SendToServiceOwners
New-AzAlertRuleEmail -CustomEmail [email protected] -SendToServiceOwner
```

This command creates an alert rule email action for the specified address and for its service owners.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This command creates a simple metric alert criteria that can be used in a metric
### Example 2: Create a dynamic metric alert criteria

```powershell
New-AzMetricAlertRuleV2Criteria -Dynamic -MetricName "Percentage CPU" -MetricNameSpace "Microsoft.Compute/virtualMachines" -TimeAggregation Average -Operator GreaterThan -ThresholdSensitivity Medium -ViolationCount 2 -ExaminedAggregatedPointCount 4
New-AzMetricAlertRuleV2Criteria -DynamicThreshold -MetricName "Percentage CPU" -MetricNameSpace "Microsoft.Compute/virtualMachines" -TimeAggregation Average -Operator GreaterThan -ThresholdSensitivity Medium -ViolationCount 2 -ExaminedAggregatedPointCount 4
```

```output
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Remove-AzActionGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The **Remove-AzActionGroup** cmdlet removes an action group.

### Example 1: Remove an action group
```powershell
Remove-AzActionGroup -ResourceGroup "Default-Web-CentralUS" -Name "myActionGroup"
Remove-AzActionGroup -ResourceGroupName "Default-Web-CentralUS" -Name "myActionGroup"
```

```output
Expand Down
4 changes: 2 additions & 2 deletions src/Monitor/Monitor/help/Remove-AzActivityLogAlert.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This cmdlet implements the ShouldProcess pattern, i.e. it might request confirma

### Example 1: Remove an activity log alert
```powershell
Remove-AzActivityLogAlert -ResourceGroup "Default-Web-CentralUS" -Name "myalert"
Remove-AzActivityLogAlert -ResourceGroupName "Default-Web-CentralUS" -Name "myalert"
```

```output
Expand All @@ -53,7 +53,7 @@ Removes an activity log alert using name and resource group name as inputs.

### Example 2: Remove an activity log alert using a PSActivityLogAlertResource as input
```powershell
Get-AzActivityLogAlert -ResourceGroup "Default-activityLogAlerts" -Name "alert1" | Remove-AzActivityLogAlert
Get-AzActivityLogAlert -ResourceGroupName "Default-activityLogAlerts" -Name "alert1" | Remove-AzActivityLogAlert
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $dcrAssoc | Remove-AzDataCollectionRule

### Example 3: Delete data collection rule with the association resource ID property
```powershell
Remove-AzDataCollectionRule -AssociationId $dcrAssoc.Id
Remove-AzDataCollectionRuleAssociation -AssociationId $dcrAssoc.Id
```

## PARAMETERS
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor/help/Set-AzActionGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The **Set-AzActionGroup** cmdlet creates a new or updates an existing action gro
```powershell
$email1 = New-AzActionGroupReceiver -Name 'user1' -EmailReceiver -EmailAddress '[email protected]'
$sms1 = New-AzActionGroupReceiver -Name 'user2' -SmsReceiver -CountryCode '1' -PhoneNumber '5555555555'
Set-AzActionGroup -Name $actionGroupName -ResourceGroup $resourceGroupName -ShortName $shortName -Receiver $email1,$sms1
Set-AzActionGroup -Name $actionGroupName -ResourceGroupName $resourceGroupName -ShortName $shortName -Receiver $email1,$sms1
```

The first two commands create two receivers.
Expand Down