From 5d7d121e1fa467ff398363403cbdb7f5a247e14c Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 13 Aug 2024 00:10:44 +0200 Subject: [PATCH] fix get state & add disable emoticon (#2554) --- functions/private/Get-WinUtilToggleStatus.ps1 | 5 +++-- functions/private/Invoke-WinUtilDetailedBSoD.ps1 | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 019978a4..ea349779 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -140,8 +140,9 @@ Function Get-WinUtilToggleStatus { } } if ($ToggleSwitch -eq "WPFToggleDetailedBSoD") { - $DetailedBSoD = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters - if($DetailedBSoD -eq 0) { + $DetailedBSoD1 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisplayParameters + $DetailedBSoD2 = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl').DisableEmoticon + if (($DetailedBSoD1 -eq 0) -or ($DetailedBSoD2 -eq 0) -or !$DetailedBSoD1 -or !$DetailedBSoD2) { return $false } else { return $true diff --git a/functions/private/Invoke-WinUtilDetailedBSoD.ps1 b/functions/private/Invoke-WinUtilDetailedBSoD.ps1 index 21b0a84f..efe4f624 100644 --- a/functions/private/Invoke-WinUtilDetailedBSoD.ps1 +++ b/functions/private/Invoke-WinUtilDetailedBSoD.ps1 @@ -18,6 +18,10 @@ Function Invoke-WinUtilDetailedBSoD { } $Path = "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl" + $dwords = ("DisplayParameters", "DisableEmoticon") + foreach ($name in $dwords) { + Set-ItemProperty -Path $Path -Name $name -Value $value + } 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"