Created
November 11, 2019 10:51
-
-
Save andrewmatveychuk/4ddaf20ea130295d7565982d6f5fe6b2 to your computer and use it in GitHub Desktop.
PowerShell script to disable all web tests in a specific resource group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $alertResourceIds = Get-AzResource -ResourceGroupName $env:resourceGroupName | Where-Object -Property ResourceType -EQ "microsoft.insights/webtests" | Select-Object -ExpandProperty ResourceId | |
| ForEach ($Id in $alertResourceIds) { | |
| $alerts = Get-AzResource -ResourceId $Id | |
| $alerts.Properties.Enabled = "False" | |
| $alerts | Set-AzResource -Force | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment