From 3c4603f5ba5dbd54d4d7bf80d5fff3f1b32c0acb Mon Sep 17 00:00:00 2001 From: Pekka Savolainen Date: Mon, 28 Oct 2024 17:22:05 +0200 Subject: [PATCH] Fix error on missing existing group --- Pinja.Azure.Alerts/Set-AlertRulesLogicAppReceiver.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pinja.Azure.Alerts/Set-AlertRulesLogicAppReceiver.ps1 b/Pinja.Azure.Alerts/Set-AlertRulesLogicAppReceiver.ps1 index 1a1130f..3f7fff7 100644 --- a/Pinja.Azure.Alerts/Set-AlertRulesLogicAppReceiver.ps1 +++ b/Pinja.Azure.Alerts/Set-AlertRulesLogicAppReceiver.ps1 @@ -116,7 +116,7 @@ function Set-AlertRulesLogicAppReceiver { if ($PSCmdlet.ShouldProcess($ResourceGroup, "Update-AzActionGroug - azure-alerts")) { - if (Get-AzActionGroup -Name "azure-alerts" -ResourceGroup $ResourceGroup) { + if (Get-AzActionGroup -Name "azure-alerts" -ResourceGroup $ResourceGroup -ErrorAction SilentlyContinue) { $alertRef = Update-AzActionGroup ` -Name "azure-alerts" ` -ResourceGroup $ResourceGroup `