⚡ PowerShell 5.1+

Get Time Zone Settings Report

Queries Win32_TimeZone via WMI and reports Time Zone Settings in a formatted table, with an optional CSV export.

By WindowsScripting.com · 902 B
Get-TimeZoneReport.ps1
<#
.SYNOPSIS
    Reports Time Zone Settings on this computer via WMI (Win32_TimeZone).

.DESCRIPTION
    Queries Win32_TimeZone and displays Description, Bias, StandardName for each item found.
    Use -ExportPath to also save the results to a CSV file.

.PARAMETER ExportPath
    Optional path to a .csv file to write the results to.

.EXAMPLE
    .\Get-TimeZoneReport.ps1

.EXAMPLE
    .\Get-TimeZoneReport.ps1 -ExportPath C:\Reports\timezone.csv
#>

[CmdletBinding()]
param(
    [string]$ExportPath
)

$items = Get-CimInstance -ClassName Win32_TimeZone | Select-Object Description, Bias, StandardName

if (-not $items) {
    Write-Host "No Time Zone Settings found." -ForegroundColor Yellow
    return
}

$items | Format-Table -AutoSize

if ($ExportPath) {
    $items | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
    Write-Host "`nExported to $ExportPath" -ForegroundColor Cyan
}