• Stars
    star
    164
  • Rank 230,032 (Top 5 %)
  • Language
    PowerShell
  • License
    Other
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross platform Powershell module to generate HTML markup language

PSHTML is a cross platform Powershell module to generate HTML markup language within a DSL on Windows and Linux.

Summary

PSHTML logo PSHTML allow people to write a HTML document(s) using powershell-like syntax, which makes building webpages easier, and less cumbersome for 'native' PowerSheller's.

PSHTML offers the flexibility of the PowerShell language, and allows to add logic in powershell directly in the HTML structure. This open the possibility to add loops, conditional statements, switches, functions, classes, calling external modules etc.. all that directly from the same editor.

PSHTML comes with template functionality which allows one to include parts of webpages that are identical throughout the web page Eg: footer, Header,Menu etc..

Using PSHTML, offers code completion and syntax highlighting from the the default powershell language. As PSHTML respects the W3C standards, any HTML errors, will be spotted immediately.

Since version 0.7.0 PSHTML supports the creation of charts.


Detailed introduction

You can find here , an introduction talk about PSHTML by Stéphane van Gulick which teach you in the first step everything you need to know to get started with PSHTML and show concret implementation examples. In the second part of the talk, Stéphane explains how one can extend PSHTML further by coupling it together with Polaris creating a full webserver 100% in powershell.

PsConfEU PSHTML Introduction


Project Status

Appveyor

master dev docs Downloads
Build status Build status Documentation Status PSHTML

AzurePipelines

overall status

master dev
Build Status Build Status

Windows

master dev
Build Status Build Status

Linux

master dev
Build Status Build Status

MacOS

master dev
N/A Build Status

A change log is available here Known issues are tracked here

A few Basic examples of what PSHTML can achieve

Basic page

The following quick example displays a simple page, with a few headers, divs, paragraphs, and header elements

Import-Module PSHTML

html {

    head{

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

    body{

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

            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"
        }

        h1 "My favorites Fruits"

        $Fruits = "Apple","Banana","Orange","Ananas"

        ul {

            foreach($fruit in $Fruits){
                li {
                    $fruit
                }
            }
        }

    }
    footer {
        p{
            "Copyright 2019"
        }
    }

}

A more advanced example

The following example is a tribute to PowerShell GodFather 'Jeffrey Snover' where we generated a BIO of the ShellFather gathering data from Wikipedia and other sources, all that using Powershell.

screen shot of PSHTML results

The example PSHTML / Powershell code is available here

The generated HTML code is available here

Charts

With version 0.7.0 PSHTML introduced the functionality of charting. In v0.8.0 this functionality has been extended and offers now a total of 7 different chart types to communicate your data to your end users, and to make your webpages look amazingly cool!

Charts Overview Charts Overview

Read more about charts and how easy it is to create them using PSHTML here.

Documentation

Check out the Documentation on how to use PSHTML.

Check out references / mentions of PSHTML around the web

The community is actively using PSHTML. Check out what people are saying about it, and how they use PSHTML to implement business solutions. There might be a case answering your specific need?

Have you used PSHTML at work to deliver an awesome project ? Please share with us your experience (Contact me to discuss this.)

See how community members use PSHTML

Find here a few examples where people already used PSHTML in various awesome ways.

Contribute

Are you interested in contributing to the PSHTML project? Read our contribution guide Here.

More Repositories

1

PSClassUtils

A set of utilities to work with Powershell Classes
PowerShell
93
star
2

HostsFileManagement

Hosts file management on Windows systems using PowerShell classes
PowerShell
27
star
3

New-Tattoo

Script to tattoo information during (or after build) of a Windows Machine.
PowerShell
11
star
4

psansible.inventory

Ansible inventory helpers
PowerShell
10
star
5

Posh-StarWars

Powershell module based on SWAPI.co API (Retrieve all information from your favorite SCI FY movie using powershell)
PowerShell
9
star
6

WMI-Commands

WMI module that includes powershell cmdlets in order to manage the local WMI repository.
PowerShell
7
star
7

Streams

Everything around my streams / Tout en rapport avec mes streams.
PowerShell
6
star
8

SCCM-Module

SCCM powershell Module 2.0
PowerShell
5
star
9

PythonLearning

Contains code usefull to learn python
Python
4
star
10

BitlockerSAK

BitlockerSAK tool
PowerShell
3
star
11

FakeFile

Generate random files with meaningfull names of specific sizes
PowerShell
3
star
12

PowerShell-Sharepoint-Community

sharepoint PowerShell helper functions
PowerShell
2
star
13

PSWeb

PowerShell
2
star
14

PowerShellCommonAlgorythms

PowerShell common Algorythms usefull to have, but difficult to remember
PowerShell
2
star
15

PowerShellClassesSeries2

Contains code related to the powershell classes series hosted on PowershellDistrict.Com
PowerShell
2
star
16

PesterSeries

Contains scripts from the PowerShell pester series on PowershellDistrict.com
PowerShell
2
star
17

Runspaces

Contains various scripts covering Runspaces
PowerShell
2
star
18

PowershellDistrictGithub

Repository example for http://PowerShellDistrict.Com
PowerShell
1
star
19

RDCM-Module

Powershell module which allows to generate automagically a Remote Desktop Connection Manager file.
PowerShell
1
star
20

PSNunit

PowerShell
1
star
21

frpsug_site

Test pour la creation du site frpsug avec pshtml
HTML
1
star
22

djangoLearning

Contains content of my learning path into the django framework
PowerShell
1
star
23

Demos

Contains my public demos held on different events or user groups meetings
PowerShell
1
star
24

Presentations

My presentations
PowerShell
1
star
25

New-FastVM

Script that helps to provision a sandbox lab on HyperV
PowerShell
1
star