The machine I am trying to use is not Domain Joined(won't be) and would like to be able to remote reboot a VM(pfSense) with a PowerShell Script.
I keep getting this error trying test my connection to the server.
PS C:\WINDOWS\system32> Get-VM –computername 'LAB1' | Where { $_.State –eq 'Running' }
Get-VM : The operation on computer 'LAB1' failed: The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or
the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by
running the following command: winrm help config.
I tried this:
winrm set winrm/config/client '@{TrustedHosts="DESKTOP-K2GD11M"}'
Enable-PSRemoting -Force
but still get the error.
I also did check with get-item wsman:\localhost\Client\TrustedHosts
and the hostname or computer name was added.