ConduitSharp.Plugin.PowerShell 2.0.0

dotnet add package ConduitSharp.Plugin.PowerShell --version 2.0.0
                    
NuGet\Install-Package ConduitSharp.Plugin.PowerShell -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConduitSharp.Plugin.PowerShell" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConduitSharp.Plugin.PowerShell" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ConduitSharp.Plugin.PowerShell" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConduitSharp.Plugin.PowerShell --version 2.0.0
                    
#r "nuget: ConduitSharp.Plugin.PowerShell, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConduitSharp.Plugin.PowerShell@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConduitSharp.Plugin.PowerShell&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ConduitSharp.Plugin.PowerShell&version=2.0.0
                    
Install as a Cake Tool

ConduitSharp PowerShell Plugin

A ready-to-use plugin for the ConduitSharp API gateway that runs an existing PowerShell (.ps1) script in-process as an HTTP endpoint.

The PowerShell 7 runtime is embedded via Microsoft.PowerShell.SDK — no system pwsh installation is required on the gateway host. The script produces the HTTP response directly, so legacy Windows automation becomes an authenticated, rate-limited, observable API without rewriting a line of it.

Installation

Drop the published plugin output (the plugin DLL and its Microsoft.PowerShell.SDK dependencies) into your gateway's configured PluginsPath (e.g., ./gateway/plugins/<route-id>/), or reference the ConduitSharp.Plugin.PowerShell package and register it in DI when embedding the gateway.

Configuration

Enable the plugin on any route in your routes.json by adding "name": "custom", "variant": "power-shell" to the route's plugin list. Use it as the terminal plugin (no http-proxy after it) — the script writes the response.

Example routes.json

{
  "id": "erp-report",
  "route": {
    "match": { "path": "/erp/reports/summary", "methods": ["GET"] }
  },
  "cluster": null,
  "plugins": [
    { "name": "jwt-auth",   "order": 1, "config": { "signingKey": "..." } },
    { "name": "rate-limit", "order": 2, "config": { "windowSeconds": 3600, "maxRequests": 100 } },
    { "name": "custom", "variant": "power-shell", "order": 99, "config": { "scriptPath": "scripts/Get-ErpReport.ps1" } }
  ]
}

Options

Setting Type Required Description
scriptPath string Yes Path to the .ps1 to run. Relative paths resolve against the gateway's base path.

The script receives the current request as a $Request parameter. $ErrorActionPreference = 'Stop' is applied, so both terminating and non-terminating script errors surface as a 500 rather than an empty body.

Production notes

Each request currently creates a fresh PowerShell instance. For concurrent load or heavy ETL workloads see PowerShell plugin: production considerations (runspace pooling, out-of-process execution, PSCustomObject memory guidance).

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 116 8/14/2026
1.0.0 119 7/25/2026