Re: [go-nuts] Trying to call powershell script from Go

2020-11-01 Thread Uzair Ally
err := exec.Command(cmdName, "script.ps1").Output() >> if err != nil { >> fmt.Fprintln(os.Stderr, "Error creating StdoutPipe for Cmd", err) >> } >> fmt.Println(string(out)) >> } >> >> ERROR: >> Error creating StdoutPipe for Cmd exit st

Re: [go-nuts] Trying to call powershell script from Go

2020-10-28 Thread Uzair Ally
powershell.exe" out, err := exec.Command(cmdName, "script.ps1").Output() if err != nil { fmt.Fprintln(os.Stderr, "Error creating StdoutPipe for Cmd", err) } fmt.Println(string(out)) } ERROR: Error creating StdoutPipe for Cmd exit status 1 On Wednesday, October 28, 2020

Re: [go-nuts] Trying to call powershell script from Go

2020-10-28 Thread Uzair Ally
cript.ps1 in double quotes and try to run, it tells me >>>> cmdName declared but no used. >>>> Yes, the script is named script.ps1. The script is not a variable. >>>> >>>> On Tuesday, October 27, 2020 at 8:22:14 PM UTC+3 Marvin Renich wrote: >

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
t tells me cmdName >> declared but no used. >> Yes, the script is named script.ps1. The script is not a variable. >> >> On Tuesday, October 27, 2020 at 8:22:14 PM UTC+3 Marvin Renich wrote: >> >>> * Uzair Ally [201027 12:25]: >>> > Hi,

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
On Tue, Oct 27, 2020 at 10:27 AM Uzair Ally wrote: > > > > > > If I add script.ps1 in double quotes and try to run, it tells me cmdName > declared but no used. > > Yes, the script is named script.ps1. The script is not a variable. > > Your program has basic issu

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi Marvin, If I add script.ps1 in double quotes and try to run, it tells me cmdName declared but no used. Yes, the script is named script.ps1. The script is not a variable. On Tuesday, October 27, 2020 at 8:22:14 PM UTC+3 Marvin Renich wrote: > * Uzair Ally [201027 12:25]: > > Hi, &

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
:47 PM UTC+3 Ian Lance Taylor wrote: > On Tue, Oct 27, 2020 at 9:25 AM Uzair Ally wrote: > > > > I am getting the following error when I try to call a powershell script > from go. > > > > undefined: script > > > > Here is the code: > > > > cm

[go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi, I am getting the following error when I try to call a powershell script from go. undefined: script Here is the code: cmdName := "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" out, err := exec.Command("cmdName", script.ps1).Output() if err != nil { fmt.Fprintln(os.Stderr,