# Detect if current user is set to 24-hour clock $short = (Get-ItemProperty -Path "HKCU:\Control Panel\International" -Name sShortTime -ErrorAction SilentlyContinue).sShortTime $long = (Get-ItemProperty -Path "HKCU:\Control Panel\International" -Name sTimeFormat -ErrorAction SilentlyContinue).sTimeFormat if ($short -eq "HH:mm" -and $long -eq "HH:mm:ss") { Write-Output "24-hour clock already configured." exit 0 # No issue found } else { Write-Output "24-hour clock NOT configured. Current: sShortTime='$short' sTimeFormat='$long'" exit 1 # Issue found -> triggers remediation } ``