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 }