executePowerPick executes unmanaged PowerShell (spawn)
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 292 | |
| 293 | // executePowerPick executes unmanaged PowerShell (spawn) |
| 294 | func (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) |
| 309 | func (e *Executor) executePsInject(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected