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

Method executePowerShellImport

workflow/executor_spawn.go:280–291  ·  view source on GitHub ↗

--- PowerShell & .NET --- executePowerShellImport imports a PowerShell script

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

Source from the content-addressed store, hash-verified

278
279// executePowerShellImport imports a PowerShell script
280func (e *Executor) executePowerShellImport(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
281 scriptPath, ok := action.Parameters["script"].(string)
282 if !ok {
283 return "", fmt.Errorf("script parameter required for powershell_import")
284 }
285
286 resp, err := client.PowerShellImport(ctx, beaconID, scriptPath)
287 if err != nil {
288 return "", err
289 }
290 return e.waitForOutput(ctx, client, resp.TaskID)
291}
292
293// executePowerPick executes unmanaged PowerShell (spawn)
294func (e *Executor) executePowerPick(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