Skip to main content

Overview

Execute shell commands (Linux) or PowerShell commands (Windows) in the sandbox environment.

Syntax

Parameters

string
required
Language to execute: 'sh' (Shell/Linux) or 'pwsh' (PowerShell/Windows)
string
required
Code or command to execute
number
required
Timeout in milliseconds
boolean
default:"false"
Suppress output if true

Returns

Promise<string> - Command output

Shell Execution (Linux)

Execute shell commands in the Linux sandbox.

Basic Commands

File Operations

PowerShell Execution (Windows)

Execute PowerShell commands in the Windows sandbox.

Software Installation

File Operations

Process Management

Environment Variables

Network Operations

Silent Execution

Suppress output for background operations:

Best Practices

Use appropriate timeouts
Handle errors gracefully
Use silent mode for background tasks
Escape strings properly in PowerShellUse proper escaping for special characters:

Complete Example