From b92a284b02c7366721bd512fa43b1874fb9cf715 Mon Sep 17 00:00:00 2001 From: Phil Bevan Date: Wed, 21 Dec 2022 09:28:29 +0000 Subject: [PATCH] Use correct null check on tags collection --- functions/TagWithCreator/run.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/TagWithCreator/run.ps1 b/functions/TagWithCreator/run.ps1 index 88de348..1a5de83 100644 --- a/functions/TagWithCreator/run.ps1 +++ b/functions/TagWithCreator/run.ps1 @@ -30,7 +30,7 @@ foreach ($case in $ignore) { $tags = (Get-AzTag -ResourceId $resourceId).Properties -if (!($tags.TagsProperty.ContainsKey('Creator')) -or ($null -eq $tags)) { +if (($null -eq $tags.TagsProperty) -or !($tags.TagsProperty.ContainsKey('Creator')) ) { $tag = @{ Creator = $caller }