diff --git a/images.CI/macos/select-datastore.ps1 b/images.CI/macos/select-datastore.ps1 index 4714bb6d3..cb04945e2 100644 --- a/images.CI/macos/select-datastore.ps1 +++ b/images.CI/macos/select-datastore.ps1 @@ -78,8 +78,8 @@ function Select-DataStore { # Wait for 60 seconds to check if any other tags are assigned to the same datastore Start-Sleep -Seconds 60 - # Take only first 2 tags, all the others will go to the next round - $tagAssignments = (Get-TagAssignment -Entity $buildDatastore).Tag.Name | Select-Object -First 2 + # Take the last tag (Last in, first out), all the others will go to the next round + $tagAssignments = (Get-TagAssignment -Entity $buildDatastore).Tag.Name | Select-Object -Last 1 $isAllow = $tagAssignments -contains $VMName if ($isAllow)