Source File
powershell.go
Belonging Package
github.com/masterzen/winrm
package winrmimport ()// Powershell wraps a PowerShell script// and prepares it for execution by the winrm clientfunc ( string) string {// Disable unnecessary progress bars which considered as stderr.= "$ProgressPreference = 'SilentlyContinue';" +// Encode string to UTF16-LE:= unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM).NewEncoder(), := .String()if != nil {return ""}// Finally make it base64 encoded which is required for powershell.= base64.StdEncoding.EncodeToString([]byte())// Specify powershell.exe to run encoded commandreturn "powershell.exe -EncodedCommand " +}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |