Skip to content

Instantly share code, notes, and snippets.

@andrewmatveychuk
Created November 11, 2019 10:51
Show Gist options
  • Select an option

  • Save andrewmatveychuk/4ddaf20ea130295d7565982d6f5fe6b2 to your computer and use it in GitHub Desktop.

Select an option

Save andrewmatveychuk/4ddaf20ea130295d7565982d6f5fe6b2 to your computer and use it in GitHub Desktop.
PowerShell script to disable all web tests in a specific resource group
$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