I like to embed some powershell scripts in one Go binary. How can I embed them and execute the commands from GO. Currently I got it by running an external script:
out,err := exec.Command("Powershell", "-file" , "C:\\test\\go\\my.ps1").Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Data from powershell script is: %s", out)
my.ps1 content:
[System.Security.Principal.WindowsIdentity]::GetCurrent().Name
I got a few more powershell scripts, I like to add the powershell scripts into my go binary file. Have tryed a few things I did find on the internet but failed.
/tmp) - then you could initiate yourexec.Command.