mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 00:08:54 +08:00
pick up a random datastore by condition (#2057)
This commit is contained in:
committed by
GitHub
parent
1be42bd050
commit
9ef75097cf
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user