[macos] VMWare host selection: do not count "vmkdump" folder as possible vm name when choosing available datastore (#7301)

This commit is contained in:
ilia-shipitsin
2023-03-17 16:51:49 +01:00
committed by GitHub
parent 754cbccf56
commit f0e54bbe9f

View File

@@ -67,7 +67,7 @@ function Select-DataStore {
$availableDatastores = $availableClusterDatastores `
| Where-Object { $_.FreeSpaceGB -ge $thresholdInGb } `
| Where-Object {
$vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch "^\.").Count
$vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch '(^\.|vmkdump)').Count
$vmOnDatastore -lt $vmCount } `
| Group-Object -Property { $vmOnDatastore }