@@ -262,6 +262,8 @@ func (snc *Agent) makeCmd(ctx context.Context, command string) (*exec.Cmd, error
262262 cmd := execCommandContext (ctx , "powershell" , env )
263263 cmd .SysProcAttr .CmdLine = fmt .Sprintf (`%s -command %s; exit($LASTEXITCODE)` , POWERSHELL , command )
264264
265+ log .Tracef ("cmd.SysProcAttr.CmdLine: %s" , cmd .SysProcAttr .CmdLine )
266+
265267 return cmd , nil
266268
267269 // command does not exist
@@ -283,6 +285,8 @@ func (snc *Agent) makeCmd(ctx context.Context, command string) (*exec.Cmd, error
283285 strings .Join (cmdArgs , " " ),
284286 )
285287
288+ log .Tracef ("cmd.SysProcAttr.CmdLine: %s" , cmd .SysProcAttr .CmdLine )
289+
286290 return cmd , nil
287291
288292 // powershell files
@@ -308,6 +312,8 @@ func (snc *Agent) makeCmd(ctx context.Context, command string) (*exec.Cmd, error
308312 cmd := execCommandContext (ctx , "powershell" , env )
309313 cmd .SysProcAttr .CmdLine = fmt .Sprintf (`%s -Command ". '%s' %s ; exit($LASTEXITCODE)"` , POWERSHELL , cmdName , strings .Join (cmdArgsModified , " " ))
310314
315+ log .Tracef ("cmd.SysProcAttr.CmdLine: %s" , cmd .SysProcAttr .CmdLine )
316+
311317 return cmd , nil
312318
313319 // other command but no shell special characters
@@ -325,6 +331,8 @@ func (snc *Agent) makeCmd(ctx context.Context, command string) (*exec.Cmd, error
325331 shell ,
326332 strings .Replace (command , cmdName , syscall .EscapeArg (cmdName ), 1 ))
327333
334+ log .Tracef ("cmd.SysProcAttr.CmdLine: %s" , cmd .SysProcAttr .CmdLine )
335+
328336 return cmd , nil
329337 }
330338}
0 commit comments