Skip to content

Instantly share code, notes, and snippets.

View wightsci's full-sized avatar

Stuart Squibb wightsci

  • United Kingdom
View GitHub Profile
<#
.SYNOPSIS
Creates an HTML report of the state of Windows Services.
.DESCRIPTION
Creates an HTML report of the state of Windows Services. Styles services in
unexpected states.
.PARAMETER ReportFile
The report file to create.
.PARAMETER Title
The Title for the report.
@wightsci
wightsci / CertCheck.ps1
Created February 17, 2020 07:57
CertCheck
<#
.SYNOPSIS
Checks for the expiry of the certificate for a web site.
.DESCRIPTION
Returns information for certificates expiring within the number of days specified.
.PARAMETER Uri
A uri or list of uris to check.
.PARAMETER Days
The number of days ahead to check for expiry. Defaults to 730 days (2 years).
.PARAMETER Path
Function Format-XMLText {
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)]
[xml[]]
$xmlText
)
Process {
# Use a StringWriter, an XMLWriter and an XMLWriterSettings to format XML
$stringWriter = New-Object System.IO.StringWriter
$stringWriterSettings = New-Object System.Xml.XmlWriterSettings