From 1d82f299b433a17849b576b6e715a93240b29fd8 Mon Sep 17 00:00:00 2001 From: Bryan McNulty Date: Wed, 9 Apr 2025 08:24:04 -0500 Subject: Update TODO; add dynamic namespace to `wmi call` --- cmd/wmi.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cmd') diff --git a/cmd/wmi.go b/cmd/wmi.go index 74996b7..59096ec 100644 --- a/cmd/wmi.go +++ b/cmd/wmi.go @@ -17,8 +17,9 @@ func wmiCmdInit() { } func wmiCallCmdInit() { - wmiCallCmd.Flags().StringVarP(&wmi.Method, "method", "m", "", `WMI Method to call (i.e. "Create")`) + wmiCallCmd.Flags().StringVarP(&dceConfig.Resource, "namespace", "n", "//./root/cimv2", "WMI namespace") wmiCallCmd.Flags().StringVarP(&wmi.Class, "class", "C", "", `WMI class to instantiate (i.e. "Win32_Process")`) + wmiCallCmd.Flags().StringVarP(&wmi.Method, "method", "m", "", `WMI Method to call (i.e. "Create")`) wmiCallCmd.Flags().StringVarP(&wmi.Args, "args", "A", "{}", `WMI Method argument(s) in JSON dictionary format (i.e. {"CommandLine":"calc.exe"})`) if err := wmiCallCmd.MarkFlagRequired("method"); err != nil { panic(err) @@ -35,10 +36,9 @@ func wmiProcessCmdInit() { var ( wmi struct { - Namespace string // TODO - Class string - Method string - Args string + Class string + Method string + Args string } wmiMethodArgsMap map[string]any @@ -64,7 +64,6 @@ References: return }), Run: func(cmd *cobra.Command, args []string) { - executor := wmiexec.Module{} cleanCfg := &exec.CleanupConfig{} // TODO connCfg := &exec.ConnectionConfig{ -- cgit v1.2.3