PowerShell remoting must first be enabled on the server to which you wish to remotely connect.

Enable-PSRemoting -Force

This command does the following:

Only for non-domain environments

For servers in an AD Domain the PS remoting authentication is done through Kerberos (‘Default’), or NTLM (‘Negotiate’). If you want to allow remoting to a non-domain server you have two options.

Either set up WSMan communication over HTTPS (which requires certificate generation) or enable basic authentication which sends your credentials across the wire base64-encoded (that’s basically the same as plain-text so be careful with this).

In either case you’ll have to add the remote systems to your WSMan trusted hosts list.

Enabling Basic Authentication

Set-Item WSMan:\\localhost\\Service\\AllowUnencrypted $true

Then on the computer you wish to connect from, you must tell it to trust the computer you’re connecting to.