Skip to content
Basic HTTP listener written in PowerShell that executes Operation Validation Framework (OVF) tests and returns results using a simple REST API
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add PSScriptAnalyzer GH Action on push Jan 18, 2019
PSHealthZ Add initial support for macOS and Linux Dec 18, 2018
Tests Refactor Dec 28, 2016
CHANGELOG.md Add initial support for macOS and Linux Dec 18, 2018
LICENSE Refactor Dec 28, 2016
README.md Add AppVeyor badge Dec 28, 2016
appveyor.yml
build.ps1
module.psdeploy.ps1
psake.ps1 Refactor Dec 28, 2016

README.md

Build status

PSHealthZ

Overview

Basic HTTP(S) listener that executes Operation Validation Framework (OVF) tests that are present on the given system and returns results using a simple REST API. This is an implementation of the Health Endpoint Monitoring Pattern using PowerShell.

Getting Started

Start the listener on the desired port and path. The command below will expose a REST endpoint at http://localhost:1938/health.

This command must be run from an elevated session.

>$listener = Start-HealthzListener -PassThru -Verbose

This will create a PowerShell job running the listener in the backgound. To see the listener details, run:

$listener | Format-List *

To test the listener, run the following:

>$r = Invoke-RestMethod -Uri 'http://localhost:1938/health'
>$r | Format-List *

Without specifying a specific test to execute, PSHealthZ will return a list of available OVF tests that are present in $env:PSModulePath.

>$r.availableTests
Storage Capacity Memory Capacity OVF.Example1
Services asdf                    OVF.Example2
More services                    OVF.Example2
Logical Disks                    OVF.Windows.Server
Memory                           OVF.Windows.Server
Network Adapters                 OVF.Windows.Server
Operating System                 OVF.Windows.Server

To execute a specific test, add '?test=<testname>' as a query parameter.

>$r = Invoke-RestMethod -Uri 'http://localhost:1938/health?test=services'

To execute tests from a specific module, add '?module=<modulename>' as a query parameter.

>$r = Invoke-RestMethod -Uri 'http://localhost:1938/health?module=ovf.example1'

You can inspect the test results with:

>$r.testResults | Format-Table *

To stop the HTTP listener, run:

$listener | Stop-HealthzListener
You can’t perform that action at this time.