From 4f906bddd3f4261b2d45bf37a4adfe795c42967e Mon Sep 17 00:00:00 2001 From: Bryan McNulty Date: Thu, 17 Apr 2025 09:55:07 -0500 Subject: Update output,IO; add output support to WMI --- cmd/root.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'cmd/root.go') diff --git a/cmd/root.go b/cmd/root.go index 3d696aa..913a44a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -54,15 +54,17 @@ var ( log = log.Level(zerolog.DebugLevel) } - if outputMethod == "smb" { - if exec.Output.RemotePath == "" { - exec.Output.RemotePath = util.RandomWindowsTempFile() - } - exec.Output.Provider = &smb.OutputFileFetcher{ - Client: &smbClient, - Share: `C$`, - File: exec.Output.RemotePath, - DeleteOutputFile: exec.Output.NoDelete, // TEMP + if outputPath != "" { + if outputMethod == "smb" { + if exec.Output.RemotePath == "" { + exec.Output.RemotePath = util.RandomWindowsTempFile() + } + exec.Output.Provider = &smb.OutputFileFetcher{ + Client: &smbClient, + Share: `C$`, + File: exec.Output.RemotePath, + DeleteOutputFile: !exec.Output.NoDelete, + } } } }, @@ -81,13 +83,10 @@ func init() { dcomCmdInit() rootCmd.AddCommand(dcomCmd) - wmiCmdInit() rootCmd.AddCommand(wmiCmd) - scmrCmdInit() rootCmd.AddCommand(scmrCmd) - tschCmdInit() rootCmd.AddCommand(tschCmd) } -- cgit v1.2.3