mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
add "Disable detailed BSoD Preference" (#2451)
This commit is contained in:
parent
313c5f59de
commit
9f33cb1b82
@ -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",
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
34
functions/private/Invoke-WinUtilDetailedBSoD.ps1
Normal file
34
functions/private/Invoke-WinUtilDetailedBSoD.ps1
Normal 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
|
||||
}
|
||||
}
|
@ -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)}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user