From 9ef75097cffa91e2b4299201496849cc77b018b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Fri, 13 Nov 2020 18:00:58 +0300 Subject: [PATCH] pick up a random datastore by condition (#2057) --- images.CI/macos/select-datastore.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images.CI/macos/select-datastore.ps1 b/images.CI/macos/select-datastore.ps1 index 2884fdf4..3daa0b39 100644 --- a/images.CI/macos/select-datastore.ps1 +++ b/images.CI/macos/select-datastore.ps1 @@ -61,7 +61,7 @@ function Select-DataStore { $buildDatastore = $allDatastores | Where-Object { $_.FreeSpaceGB -ge $thresholdInGb } | Where-Object { $vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch "^\.").Count $vmOnDatastore -lt $vmCount - } | Select-Object -ExpandProperty Name -First 1 + } | Get-Random | Select-Object -ExpandProperty Name $tag = Get-Tag -Category $TagCategory -Name $VMName -ErrorAction Ignore if (-not $tag)