Skip to content

v2.0.0: rebuilt as a tested module with security posture checks

Latest

Choose a tag to compare

@Hawkode Hawkode released this 13 Nov 20:13
· 1 commit to main since this release

v1 was a single script pasted into the README. v2 is a PowerShell module with tests and CI.

Highlights

  • 12 checks with Warning/Critical thresholds: CPU, memory, disk, uptime, network, Defender real-time protection, Tamper Protection and signature age, firewall profiles, pending reboot, patch age, event log clearing (Security 1102, System 104), BitLocker.
  • A check that cannot run reports Unknown, never OK.
  • Output to JSONL, CSV and the Application event log, with fixed event IDs per check and severity plus a heartbeat (EID 1000) for "monitor went quiet" alerting in Splunk.
  • Register-HealthMonitorTask runs it as SYSTEM and refuses to register if anyone other than SYSTEM, Administrators or TrustedInstaller can write to or owns the files it loads.
  • Install.ps1 installs for all users with an exact admin-only ACL and owner.
  • 50 Pester tests, run in CI on Windows PowerShell 5.1 and PowerShell 7, plus PSScriptAnalyzer.

v1 bugs fixed

  • Memory figures were 1024 times too small (KB divided by 1MB, labelled MB).
  • Mapped network drives counted as disks; no free percentage.
  • Any adapter up, including Hyper-V and VPN, reported as "Connected".
  • One failing call stopped the whole script; the log grew without limit.

Install

Elevated PowerShell, from the extracted folder:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\Install.ps1
Import-Module WindowsHealthMonitor
Get-HealthSnapshot | Test-HealthSnapshot | Format-Table Check, Target, Status, Message -AutoSize

From a downloaded zip, run Get-ChildItem -Recurse -File | Unblock-File first.

Full details: CHANGELOG.md