Skip to content

Commit

Permalink
onerror stop for tag set
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthebrit committed Apr 28, 2021
1 parent e454e99 commit e9992ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AzBulkDelete/Start-AzureBulkShutdown.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ function Start-AzureBulkShutdown
if(!$tags.ContainsKey($configurationSettings.tagName)) #not already got the tag
{
Write-Output " - Adding Tag to resource"
Update-AzTag -ResourceId $actionObject.ResourceID -Tag $tagToStamp -Operation Merge > $null
Update-AzTag -ResourceId $actionObject.ResourceID -Tag $tagToStamp -Operation Merge -ErrorAction Stop > $null
}
}
else #no tags
{
Write-Output " - Setting tag on resource"
New-AzTag -ResourceId $actionObject.ResourceID -Tag $tagToStamp > $null #just set to the tag quietly
New-AzTag -ResourceId $actionObject.ResourceID -Tag $tagToStamp -ErrorAction Stop > $null #just set to the tag quietly
}
}
catch
Expand Down

0 comments on commit e9992ca

Please sign in to comment.