Fix update test resources tagging when tags are empty. Bump max limit (#5048)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2023-10-19 15:58:56 -07:00 коммит произвёл GitHub
Родитель 860240fec9
Коммит 21978a69d8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -26,7 +26,7 @@ param (
[string] $SubscriptionId, [string] $SubscriptionId,
[Parameter()] [Parameter()]
[ValidateRange(1, 7*24)] [ValidateRange(1, 30*24)]
[int] $DeleteAfterHours = 48 [int] $DeleteAfterHours = 48
) )
@ -136,6 +136,9 @@ try {
Log "Updating DeleteAfter to '$deleteAfter'" Log "Updating DeleteAfter to '$deleteAfter'"
Write-Warning "Any clean-up scripts running against subscription '$SubscriptionId' may delete resource group '$ResourceGroupName' after $DeleteAfterHours hours." Write-Warning "Any clean-up scripts running against subscription '$SubscriptionId' may delete resource group '$ResourceGroupName' after $DeleteAfterHours hours."
if (!$resourceGroup.Tags) {
$resourceGroup.Tags = @{}
}
$resourceGroup.Tags['DeleteAfter'] = $deleteAfter $resourceGroup.Tags['DeleteAfter'] = $deleteAfter
Log "Updating resource group '$ResourceGroupName'" Log "Updating resource group '$ResourceGroupName'"