Host a powershell process inside your go app.

go get



PkgGoDev GoReport GoLang .github/workflows/main.yml semantic-release Conventional Commits KeepAChangelog License

Package gopwsh is a simple host for PowerShell with-in your Go code.

Originally inspired by

Quick Start

go get -u

package main

import (


func main() {
	shell := gopwsh.MustNew()
	defer shell.Exit()
	stdout, _, err := shell.Execute("Get-ComputerInfo")
	if err != nil {

Also see further working examples under:

Cross Platform Support

PowerShell these days of course is a cross platform shell, able to run on Windows, MacSO & Linux.

This go module should in theory work on all those platforms too.

But (at this stage) has not been tested anywhere apart from Windows. Who uses PowerShell outside of Windows... sorry thats short sighted & naive of me.

Eventually I'll get around to writing a full test suite but until then if you are one of these users & notice a bug, PRs are of course welcome :)