Powershell PS In Case Of

Powershell PS In Case Of

2020-11-29. Category & Tags: Windows, Powershell, SSH, Ps

See also SSH.

Overview: for both server and client: enable remote manager on both sides; set the other side as trusted.

On both:

Enable-PSRemoting -SkipNetworkProfileCheck -Force
Set-Item wsman:\localhost\Client\TrustedHosts -value 192.168.1.*

On the client:

Enter-PSSession 192.168.xx.xx -Credential <server_computername>\<username>

Tip:

$Env:COMPUTERNAME  # for computername
$Env:USERNAME      # for username

[ref]