aboutsummaryrefslogtreecommitdiff
path: root/cmd/root.go
diff options
context:
space:
mode:
authorBryan McNulty <bryanmcnulty@protonmail.com>2025-04-17 09:55:07 -0500
committerBryan McNulty <bryanmcnulty@protonmail.com>2025-04-17 09:55:07 -0500
commit4f906bddd3f4261b2d45bf37a4adfe795c42967e (patch)
treeb926e0d5a3520234f08209db68069d780a9e9230 /cmd/root.go
parentfc2ed14f92dd82268ca94d3d08c3760aba534d3f (diff)
downloadgoexec-4f906bddd3f4261b2d45bf37a4adfe795c42967e.tar.gz
goexec-4f906bddd3f4261b2d45bf37a4adfe795c42967e.zip
Update output,IO; add output support to WMI
Diffstat (limited to 'cmd/root.go')
-rw-r--r--cmd/root.go23
1 files changed, 11 insertions, 12 deletions
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)
}