masterzen / winrm

Command-line tool and library for Windows remote command execution in Go
Apache License 2.0
425 stars 129 forks source link

Expose client.SendMessage #145

Closed kke closed 11 months ago

kke commented 11 months ago

I've been half-fantasizing about writing a PowerShell Remoting Protocol client after glancing the spec at learn.microsoft.com, Python's pypsrp, the PSRP-enabled Ruby winrm gem, PowerShell source and the article A look under the hood at Powershell Remoting through a cross plaform lens.

masterzen/winrm already implements the bits for negotiating the connection and sending/receiving wsman/soap messages, but the problem is that it doesn't expose any methods for sending/receiving raw messages.

This PR exposes the *winrm.Client's sendMessage function as SendMessage which should be enough to implement any custom functionality on top of the opened connection.

kke commented 11 months ago

It's not enough.