cheers, Luc! amazing as always
i was getting an error on $cl.MoRef (Get-View : Cannot convert 'System.Object[]' to the type 'VMware.Vim.ManagedObjectReference' required by parameter 'SearchRoot'. Specified method is not supported).
tinkered a bit and it didn't seem to like something with Filter @{Name='cluster'} but works great without that part.
$caName = 'Owner'
$caValue = 'testuser'
$clusterName = 'Workstation Cluster'
$ca = Get-CustomAttribute -Name $caName
$cl = Get-View -ViewType ClusterComputeResource -Property Name
Get-View -ViewType VirtualMachine -SearchRoot $cl.name.MoRef -Property Name,Value | where{$_.Value.where{$_.Key -eq $ca.Key -and $_.Value -eq $caValue}} | Select Name
my original command: TotalSeconds : 24.0449337
your way: TotalSeconds : 0.5140654