[macOS] Improve select-datastore script (#2771)

* select last one

* Fix comment
This commit is contained in:
Mikhail Timofeev
2021-02-20 15:40:18 +03:00
committed by GitHub
parent b42272d743
commit 990889bcf0

View File

@@ -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)