Kestrun
PowerShell brains. Kestrel speed
Kestrun jumpstarts your web automation with a fast, PowerShell-centric framework built on ASP.NET Core, blending scriptable flexibility with modern .NET performance.
Get started now View it on GitHub
Kestrun is a PowerShell-integrated framework on ASP.NET Core (Kestrel) designed for REST API development. It combines the performance of C# with the flexibility of PowerShell, making it easy to prototype, automate, and deliver production-ready APIs with confidence.
Highlights
- PowerShell-first routing — author endpoints with
Add-KrMapRouteor Razor+PS hybrids. - Auth built-ins — JWT, API keys, Kerberos, client certs.
- Razor + PS — serve
.cshtmlwith.ps1backers. - Scheduling — PowerShell and C# jobs with cron-like control.
- Logging — Serilog, syslog, REST; structured logs galore.
- OpenAPI — generate specs, validate I/O.
- WebDAV, SMTP/FTP — expand beyond HTTP when you want to get naughty.
Quick links
- 👉 PowerShell Cmdlets: pwsh/cmdlets/
- 👉 C# API: cs/api/
- 📚 Tutorials: pwsh/tutorial/
- 📘 Guides: Logging
Getting started
# spin up Kestrun
Import-Module Kestrun
New-KrServer -Name 'MyKestrunServer'
Add-KrEndpoint -Port 5000
Enable-KrConfiguration
Add-KrMapRoute -Verbs Get -Path '/ps/hello' -ScriptBlock {
Write-KrTextResponse -inputObject "Hello world" -statusCode 200
}
Add-KrMapRoute -Verbs Get -Path '/cs/hello' -Code @'
Context.Response.WriteTextResponse("Hello world", 200);
'@ -Language CSharp
Start-KrServer