add "Disable detailed BSoD Preference" (#2451)

This commit is contained in:
MyDrift 2024-07-31 03:50:50 +02:00 committed by GitHub
parent 313c5f59de
commit 9f33cb1b82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 0 deletions

View File

@ -3152,6 +3152,14 @@
"Order": "a204_",
"Type": "Toggle"
},
"WPFToggleDetailedBSoD": {
"Content": "Detailed BSoD",
"Description": "If Enabled then you will see a detailed Blue Screen of Death (BSOD) with more information.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a205_",
"Type": "Toggle"
},
"WPFOOSUbutton": {
"Content": "Run OO Shutup 10",
"category": "z__Advanced Tweaks - CAUTION",

View File

@ -154,4 +154,13 @@ Function Get-WinUtilToggleStatus {
return $true
}
}
if ($ToggleSwitch -eq "WPFToggleDetailedBSoD") {
$DetailedBSoD = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters
if($DetailedBSoD -eq 0) {
return $false
}
else{
return $true
}
}
}

View File

@ -0,0 +1,34 @@
Function Invoke-WinUtilDetailedBSoD {
<#
.SYNOPSIS
Enables/Disables Detailed BSoD
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl' -Name 'DisplayParameters').DisplayParameters
#>
Param($Enabled)
Try{
if ($Enabled -eq $false){
Write-Host "Enabling Detailed BSoD"
$value = 1
}
else {
Write-Host "Disabling Detailed BSoD"
$value =0
}
$Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl"
Set-ItemProperty -Path $Path -Name DisplayParameters -Value $value
}
Catch [System.Security.SecurityException] {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
}
Catch [System.Management.Automation.ItemNotFoundException] {
Write-Warning $psitem.Exception.ErrorRecord
}
Catch{
Write-Warning "Unable to set $Name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -32,5 +32,6 @@ function Invoke-WPFToggle {
"WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)}
"WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)}
"WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)}
"WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $(Get-WinUtilToggleStatus WPFToggleDetailedBSoD)}
}
}