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 web framework on ASP.NET Core (Kestrel) — blend C# power with the sensual flow of PowerShell scripts.
Highlights
- PowerShell-first routing — author endpoints with
Add-KrMapRoute
or Razor+PS hybrids. - Auth built-ins — JWT, API keys, Kerberos, client certs.
- Razor + PS — serve
.cshtml
with.ps1
backers. - 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/
Getting started
# spin up Kestrun
Import-Module Kestrun
New-KrServer -Name 'MyKestrunServer'
Add-KrListener -Port 5000
Add-KrPowerShellRuntime
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