Build REST Service in PowerShell using Polaris


The author say that Polaris is “a cross-platform, minimalist web framework for PowerShell.”

This framework allows it to easily build your own RESTful webservice with only PowerShell. Polaris is free, open source, and also written in PowerShell.

The project is hosted on GitHub. Tyler Leonhardt together with Micah Rairdon and other members in the community are maintaining the project actively.


The following terms are good to be known when working with REST.


Representational State Transfer (REST) provides a standardized interface commonly used for machine-to-machine communication.


CRUD abbreviates Create, Read, Update, and Delete. A (REST) API usually provide these common set of functions.


The process of allocating a HTTP method to a webservice function is called mapping.
the table below shows a common practice:

REST method Webservice function
POST C: Create
GET R: Read
PUT U: Update
DELETE D: Delete


JavaScript Object Notation (JSON) allows it to conserve structured data like objects, properties, and lists and their relation to each other. Serialization is the procedure to convert virtual objects to be conservable. Deserialization is the other way around. Polaris uses JSON to send and retrieve information, for example:

   “cars”: {


PowerShell offers easy handling with ConvertFrom-Json and ConvertTo-Json.

Consumption via Squared Up

The WEB API TILE from Squared Up allows to read data from a REST service and shows it on a Dashboard. With Polaris you can now query any data source that provides a PowerShell interface to pass it’s information to a dashboard.


Concrete examples will follow.


Further reading

A while ago I blogged on 4sysops an example of using Polaris. It helps to get a first understanding on how it works.

One thought on “Build REST Service in PowerShell using Polaris”

Leave a Reply

Your email address will not be published.