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

Method executePowerShell

workflow/executor.go:1045–1057  ·  view source on GitHub ↗

executePowerShell executes a PowerShell command

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

Source from the content-addressed store, hash-verified

1043
1044// executePowerShell executes a PowerShell command
1045func (e *Executor) executePowerShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
1046 command, ok := action.Parameters["command"].(string)
1047 if !ok {
1048 return "", fmt.Errorf("command parameter required for powershell")
1049 }
1050
1051 resp, err := client.ExecutePowerShell(ctx, beaconID, command)
1052 if err != nil {
1053 return "", err
1054 }
1055
1056 return e.waitForOutput(ctx, client, resp.TaskID)
1057}
1058
1059// executeUpload uploads a file to the beacon's current working directory
1060func (e *Executor) executeUpload(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