title: Getting error while trying to invoke a powershell command on a remote machine
body: <p>machineName have tried executing a script using invoke-command in the following way:</p>
  
  <pre><code> Invoke-command -filepath C:\scripts\GettMembers.ps1 -computername "machinename" -credential $Getcredential 
  </code></pre>
  
  <p>But I am getting the following error :</p>
  
  <pre><code>Connecting to remote server failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
  </code></pre>
  
  <p>But I was able to add the machine to the trusted hosts of the local machine using the following command :  </p>
  
  <pre><code>winrm set winrm/config/client `@{TrustedHosts="machineName"}' 
  </code></pre>