Thanks Lucd , It looks grate.
i want to repeat enter VC using same code, is it work ?
i used below your snippet for testing out put i get only first set..
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Get-Cluster -PipelineVariable cluster |
ForEach-Object -Process {
$esx = Get-VMHost -Location $cluster |where{$_.ConnectionState -eq 'Connected'}
if($esx.Count -eq $cluster.ExtensionData.Host.Count){
$esx|?{$_.Manufacturer -eq "HPE" -and $_.build -ne "XXXX"}| Get-Random |
#Remediate-Inventory -Entity -Baseline (Get-Baseline -Name "BaselineName")-Confirm:$false -ErrorAction SilentlyContinue -RunAsync
select name,parent,build,Manufacturer
}
}
++++++++++++++++++++++++++++++++++++++++++++