This package enables clients written in Go to quickly upload files to a Windows server, based on the Windows Remote Management (WinRM) protocol.
The approach to copying files is the same as Ansible's, and directories can be recursively copied in parallel. These two features make this package hundreds of times faster than github.com/packer-community/winrmcp.
To realize the above, this package exposes WinRM functionality useful for passing data to PowerShell pipelines via stdin, that is not available in github.com/masterzen/winrm:
- The command options
WINRS_CONSOLEMODE_STDIN
andWINRS_SKIP_CMD_SHELL
are exposed. These options are defined here. - The stdin stream of a command can be closed.
It should be noted that github.com/masterzen/winrm has better documentation than this package, and will probably be better maintained. But we have a simpler way of supporting different authentication methods, by allowing users to set a *http.Client
rather than inventing another abstraction.
See test/main.go for example code.