Documentation
¶
Overview ¶
Package winrmclient provides a thin WinRM wrapper for executing PowerShell commands on remote Windows hosts via WinRM (PowerShell Remoting).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
Discover tries multiple WinRM transport configurations and returns the first working client. It probes in order: HTTP+NTLM:5985, HTTPS+NTLM:5986, HTTP+Basic:5985, HTTPS+Basic:5986. Each probe runs a lightweight PowerShell command with a short timeout. The returned client uses the full operational timeout from cfg.Timeout.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a WinRM connection to a remote Windows host.
type Config ¶
type Config struct {
Host string
Port int
Username string // DOMAIN\user or user@domain
Password string
UseHTTPS bool
UseBasic bool // Use Basic auth instead of NTLM
Timeout time.Duration
}
Config holds WinRM connection parameters.
type DiscoverConfig ¶
type DiscoverConfig struct {
Host string
Username string
Password string
Timeout time.Duration // operational timeout for the returned client
}
DiscoverConfig holds non-transport WinRM parameters for auto-discovery. Discover() cycles through transport combinations to find a working one.