Creating and hosting beautifull websites using Powershell PSHTML and Polaris

By van Gulick Stéphane

Elevator Pitch

Without the right tools, building a website or creating simple HTML reports can be a dauting task. PSHTML simplifies this proces by providing a HTML DSL for PowerShell. When combined with Polaris, it shines even more, and allows to create beautifull looking sites using the Powershell language only.

Description

Generating HTML from Powershell is not new, and has been possible since the first version of Powershell. With the introduction of PSHTML, it simply got to the next stage. In this session you will learn How PSHTML will change your way of creating HTML reports and even teach you how to create and host your own Website(s), all from within the Powershell prompt. You will learn that this process has radically changed, is now standardized and became piece of cake to do (and of course, super fun! ;)) Technologies such as PSHTML, Polaris, Polwershell classes, NodeJS, HTML (Some Javascript) will be presented / discussed during this talk.

Notes

I am the author of and main contributor of the Powershell module PSHTML which is hosted on this project page -> PSHTML. PSHTML Is a DSL I built to simplify the creation of Websites / HTML reports. Were before one needed to do ‘string’ concatenations to generate HTML text, we can now rely on a solid framework that abstract that for us, and simply write HTML like syntax confortably from our IDE, never leaving the PowerShell language. (See at the end for an example).

PSHTML shows his strenght when you combine it with Polaris. This allows one create a webserver and host / server pages that are dynamically rendered by PSHTML (!!)

I am the author creator and maintainer of PSHTML. Therefor, I think I am the best person to talk about this module and what it brought to me, and how it can help others ;)

This is an example of how we would generate a very simple HTML document

```powershell html {

head{

    title "woop title"
    link "css/normalize.css" "stylesheet"
}

body{

    Header {
        h1 "This is h1 Title in header"
        div {
            p {
                "This is simply a paragraph in a div."
            }
        }
    }


        p {
            h1 "This is h1"
            h2 "This is h2"
            h3 "This is h3"
            h4 "This is h4"
            h5 "This is h5"
            h6 "This is h6"
            strong "plop";"Woop"
        }
}

} ```

I don’t have any special technical prerequistes for this demo.