{"id":"9825be4e-300c-4bce-90d8-96c3e8d3d00b","task":"set up PowerShell 7 remoting over SSH between Windows and Linux hosts using Enter-PSSession -HostName","domain":"learn.microsoft.com","steps":["Install PowerShell 7+ and an SSH server/client on both ends, then configure the `subsystem powershell` entry in sshd_config to point at pwsh.","Connect interactively with `Enter-PSSession -HostName <server> -UserName <user>`, which uses SSH as transport instead of WinRM.","Run one-off remote commands non-interactively with `Invoke-Command -HostName <server> -UserName <user> -ScriptBlock { ... }`.","Authenticate with a private key instead of an interactive credential prompt using `-KeyFilePath <path-to-private-key>`.","Create a reusable persistent connection with `New-PSSession -HostName <server> -UserName <user>` for multiple subsequent commands."],"gotchas":["The SSH parameter set (-HostName/-UserName/-KeyFilePath) is mutually exclusive with the WinRM parameter set (-ComputerName); mixing them in one cmdlet call errors out.","The remote machine must already have PowerShell installed with its SSH server's subsystem configured for pwsh; otherwise SSH connects but drops into the OS's normal shell instead of a PowerShell session.","Interactive password prompts don't work in unattended scripts; key-based auth via -KeyFilePath is required, and the key's file permissions must be locked down or SSH refuses to use it."],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/9825be4e-300c-4bce-90d8-96c3e8d3d00b"}