On the remote machine, enable WinRM and PowerShell remoting (requires admin): Enable-PSRemoting -Force
Run a one-off command on a remote host: Invoke-Command -ComputerName <HOSTNAME> -ScriptBlock { Get-Service } -Credential (Get-Credential)
Open an interactive session: Enter-PSSession -ComputerName <HOSTNAME> -Credential (Get-Credential); exit the session with Exit-PSSession.
For repeated remote calls, create a persistent session to avoid reconnection overhead: $s = New-PSSession -ComputerName <HOSTNAME>; Invoke-Command -Session $s -ScriptBlock { ... }; Remove-PSSession $s
Test connectivity and WinRM availability: Test-WSMan -ComputerName <HOSTNAME>
Known gotchas
PowerShell Remoting uses WinRM (HTTP port 5985 or HTTPS port 5986 by default); both ends must allow these ports through the firewall.
Kerberos authentication is the default in domain environments; in workgroup scenarios, add the remote host to TrustedHosts on the client: Set-Item WSMan:\localhost\Client\TrustedHosts -Value '<HOSTNAME>'
The -Credential parameter expects a PSCredential object; passing plain-text credentials in scripts is discouraged — use Get-Credential interactively or store credentials securely.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp