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:
Родитель
860240fec9
Коммит
21978a69d8
|
@ -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'"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче