I'm having a problem using the Get-VMHost command in a Powershell script I'm trying to develop. The command is simply
Get-VMHost <hostname> | fl
Where <hostname> is the actual name of my VMware host. The results are:
Get-VMHost : 3/9/2016 5:28:43 PM Get-VMHost The underlying connection was closed: Could not establish trust relationship for the
SSL/TLS secure channel.
At line:1 char:1
+ Get-VMHost $VMHostname | fl
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VMHost], ViError
+ FullyQualifiedErrorId : Client20_QueryServiceImpl_RetrievePropertiesEx_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVMHost
Get-VMHost : 3/9/2016 5:28:43 PM Get-VMHost The underlying connection was closed: Could not establish trust relationship for the
SSL/TLS secure channel.
At line:1 char:1
+ Get-VMHost $VMHostname | fl
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VMHost], ViError
+ FullyQualifiedErrorId : Client20_QueryServiceImpl_RetrievePropertiesEx_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVMHost
Get-VMHost : 3/9/2016 5:28:43 PM Get-VMHost VMHost with name <hostname> was not found using the specified filter(s).
At line:1 char:1
+ Get-VMHost $VMHostname | fl
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-VMHost], VimException
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVMHost
Any help would be greatly appreciated.