Hi,
would this work?
$usr = "root"
$pass = "secretpassword"
$hosts = Get-View -ViewType Hostsystem | Sort Name | Select -Expandproperty Name
foreach ( $singlehost in $hosts ) {
Write "Processing" $singlehost"...."
connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_ | Get-View).ConfigManager.HealthStatusSystem).ResetSystemHealthInfo()
connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_| Get-View).ConfigManager.HealthStatusSystem).UpdateViewData()
connect-viserver $singlehost -User $usr -Password $pass |(Get-View (Get-VMHost $_ | Get-View).ConfigManager.HealthStatusSystem).RefreshHealthStatusSystem()
Disconnect-VIServer -Server $singlehost
Write "next Host..."
}