VMware is aware about this issue and currently there is no resolution. This is expected to be fixed in the future release.
Workaround:
Workaround 1:
Close and Reopen PowerCLI session.
Workaround 2:
When PowerCLI is connected using FQDN post ESXi host reboot, customer should reconnect to host via IP address and vice-versa.
- Connect-VIServer ESXiHostname -User root -Password 'xxxxxxxx' # Connect and work as usual
- Get-VM
- Get-VMHost | Restart-VMHost -Force # Reboot the ESX server you're connected to
- Disconnect-VIServer ESXiHostname # Disconnect right after initiating the server reboot
- Start-Sleep (60 * 5) # Wait 5 minutes for the server to boot up - you may want to tweak this interval or implement polling
- Connect-VIServer ESXiHostname -User root -Password 'xxxxxxxx' # Connect again and continue working as usual
- Get-VM