Skip to main content
Glama
danielklecha

mcp-server-for-powershell

run_powershell

Execute PowerShell commands safely using structured JSON definitions to run single commands, .NET methods, pipelines, or command sequences.

Instructions

Executes PowerShell commands based on a structured JSON definition. This tool allows you to run PowerShell commands safely strings. It expects a JSON string that defines the command(s), parameters, pipelines, and sequences. Args: json: A JSON string defining the command structure. Structure examples: 1. Single Command: [{"command": "Get-Item", "parameters": ["."]}] 2. .NET Static Method: [{"command": "[System.Math]::Sqrt", "parameters": [16]}] # Generates: [System.Math]::Sqrt(16) 3. Command with Named Parameters: [{"command": "Get-Item", "parameters": {"-Path": "."}}] 4. Pipeline: [{"command": "Get-Process", "then": {"command": "Select-Object", "parameters": ["Name"]}}] 5. Sequence (Multiple commands): [{"command": "mkdir", "parameters": ["test"]}, {"command": "cd", "parameters": ["test"]}] Returns: The standard output of the executed PowerShell command(s), or an error message if execution fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYes
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielklecha/mcp-server-for-powershell'

If you have feedback or need assistance with the MCP directory API, please join our Discord server