Skip to content

Hvid/Polaris

 
 

Repository files navigation

Polaris

Join the chat at https://gitter.im/PowerShellPolaris/Lobby Travis Build status

A cross-platform, minimalist web framework for PowerShell.

Disclaimer

Polaris is currently an unsupported, experimental, proof-of-concept. There is no current plan to turn it into a supported Microsoft product.

That being said, we do plan on continuing to experiment within this repository for the forseeable future.

Example

New-PolarisGetRoute -Path "/helloworld" -ScriptBlock {
    $response.Send('Hello World!');
}

Start-Polaris

Why yet another web framework for PowerShell?

There have been a great list of other micro web frameworks written over the years (Thanks @jaykul for the list!).

Polaris' differentiation is that it is cross-platform and uses the .NET HttpListener class.

Getting Started

Prereqs

Steps

  1. Clone or download the zip of the repo
  2. Open PowerShell

At this point, you can now run Import-Module ./Polaris.psd1 to start using Polaris! Checkout the wiki for more usage!

You can also run all the Pester tests by running Invoke-Pester in the test directory. You may need the fork of Pester that supports PowerShell.

Installation from the PowerShell Gallery coming soon!

Roadmap

We have a few paths we are interested in taking. We hope the community helps direct us.

  • Expanding on the current implementation using HttpListener to deliver features you'd expect from projects ASP.NET or Expressjs (route parameters, query parameters, middleware, auth etc)

  • Investigating the use of Kestrel/ASP.NET Routing instead of HttpListener

  • Creating a routing domain-specific language (DSL) for isolating and running script blocks as routes. Drawing inspiration from Pester.

Feedback

This project is an experiment that has the possibility to grow into something great. We can't do that without great feedback from you.

If you have an idea or find a bug, join the discussions in the issues or create a new issue.

Limitations

  • All script executions happen in a sandboxed runspace which means common parameters can not be shared between routes

License

Polaris is licensed under the MIT License.

Maintainers

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

A cross-platform, minimalist web framework for PowerShell

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 98.9%
  • HTML 1.1%