PS C:\Users\CheckWindUserPrd> $session = New-PSSession -ComputerName 10.0.0.4 -ConfigurationName PowerShell.7
New-PSSession : [10.0.0.4] Connecting to remote server 10.0.0.4 failed with the following error message : 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. For more information, see the about_Remote_Troubleshooting Help topic.
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "10.0.0.4" -Concatenate
$session = New-PSSession -ComputerName 10.0.0.4
Invoke-Command -Session $session -ScriptBlock { .\labtech.exe }