MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executePowerPick

Method executePowerPick

workflow/executor_spawn.go:294–306  ·  view source on GitHub ↗

executePowerPick executes unmanaged PowerShell (spawn)

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

292
293// executePowerPick executes unmanaged PowerShell (spawn)
294func (e *Executor) executePowerPick(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
295 commandlet, ok := action.Parameters["commandlet"].(string)
296 if !ok {
297 return "", fmt.Errorf("commandlet parameter required for powerpick")
298 }
299 args, _ := action.Parameters["args"].(string) // optional
300
301 resp, err := client.PowerPick(ctx, beaconID, commandlet, args)
302 if err != nil {
303 return "", err
304 }
305 return e.waitForOutput(ctx, client, resp.TaskID)
306}
307
308// executePsInject executes unmanaged PowerShell (inject)
309func (e *Executor) executePsInject(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected