2024-07-30 20:50:50 -05:00
|
|
|
Function Invoke-WinUtilDetailedBSoD {
|
|
|
|
<#
|
|
|
|
|
|
|
|
.SYNOPSIS
|
|
|
|
Enables/Disables Detailed BSoD
|
|
|
|
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
|
2024-08-06 15:50:36 -05:00
|
|
|
|
2024-07-30 20:50:50 -05:00
|
|
|
|
|
|
|
#>
|
|
|
|
Param($Enabled)
|
2024-08-06 15:35:17 -05:00
|
|
|
try {
|
|
|
|
if ($Enabled -eq $false) {
|
2024-07-30 20:50:50 -05:00
|
|
|
Write-Host "Enabling Detailed BSoD"
|
|
|
|
$value = 1
|
2024-08-06 15:35:17 -05:00
|
|
|
} else {
|
2024-07-30 20:50:50 -05:00
|
|
|
Write-Host "Disabling Detailed BSoD"
|
|
|
|
$value =0
|
|
|
|
}
|
|
|
|
|
|
|
|
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
|
2024-08-12 17:10:44 -05:00
|
|
|
$dwords = ("DisplayParameters", "DisableEmoticon")
|
|
|
|
foreach ($name in $dwords) {
|
|
|
|
Set-ItemProperty -Path $Path -Name $name -Value $value
|
|
|
|
}
|
2024-07-30 20:50:50 -05:00
|
|
|
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
|
2024-08-06 15:35:17 -05:00
|
|
|
} catch [System.Security.SecurityException] {
|
2024-07-30 20:50:50 -05:00
|
|
|
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
|
2024-08-06 15:35:17 -05:00
|
|
|
} catch [System.Management.Automation.ItemNotFoundException] {
|
2024-07-30 20:50:50 -05:00
|
|
|
Write-Warning $psitem.Exception.ErrorRecord
|
2024-08-06 15:35:17 -05:00
|
|
|
} catch {
|
2024-07-30 20:50:50 -05:00
|
|
|
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
|
|
Write-Warning $psitem.Exception.StackTrace
|
|
|
|
}
|
2024-08-06 15:35:17 -05:00
|
|
|
}
|