Project

PSWinDocumentation.O365HealthService

PSWinDocumentation.O365HealthService is a Powershell module that has a single goal of getting Office 365 Health Status

Stars23
Forks11
Open issues1
PowerShell Gallery downloads693713
Releasev1.0.4
Language: PowerShell Updated: 2026-02-14T21:45:05.0000000+00:00

Curated Examples

Build service health HTML report

Render Microsoft 365 service health data into a local HTML report.

This pattern is useful when operations needs a shareable report instead of console output.

It is adapted from Examples/Example-Office365StatusUsingDashimo.ps1.

Example

Import-Module PSWinDocumentation.O365HealthService
Import-Module PSWriteHTML

$applicationId = '<application-id>'
$applicationKey = '<client-secret>'
$tenantDomain = 'contoso.com'
$reportPath = Join-Path $PSScriptRoot 'Health.html'

$health = Get-Office365Health -ApplicationID $applicationId -ApplicationKey $applicationKey -TenantDomain $tenantDomain -Verbose

Dashboard -FilePath $reportPath {
    TabOption -BorderRadius 0px -BackgroundColorActive DimGrey
    SectionOption -BorderRadius 0px -HeaderBackGroundColor DimGrey
    TableOption -DataStore JavaScript -ArrayJoinString '; ' -ArrayJoin -BoolAsString

    Tab -Name 'Current Status' {
        Section -Name 'Current Status' {
            Table -DataTable $health.CurrentStatus -Filtering {
                TableCondition -Name 'ServiceStatus' -Value 'serviceOperational' -BackgroundColor MintGreen -FailBackgroundColor Salmon
            }
        }
    }

    Tab -Name 'Incidents' {
        Section -Name 'Incidents' {
            Table -DataTable $health.Incidents -Filtering {
                TableCondition -Name 'IsResolved' -Value $true -BackgroundColor MintGreen -FailBackgroundColor Salmon -ComparisonType bool
            }
        }
    }
} -Online -ShowHTML

What this demonstrates

  • combining service health collection with PSWriteHTML output
  • writing the report to a script-local file
  • keeping credentials as placeholders in public documentation

Source