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
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
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:
>
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,
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
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,
&
: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
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,