mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Fix Modern Standby check to be language-independant
This commit is contained in:
@@ -544,29 +544,25 @@ function Strip-Progress {
|
|||||||
|
|
||||||
# Check if this machine supports S0 Modern Standby power state. Returns true if S0 Modern Standby is supported, false otherwise.
|
# Check if this machine supports S0 Modern Standby power state. Returns true if S0 Modern Standby is supported, false otherwise.
|
||||||
function CheckModernStandbySupport {
|
function CheckModernStandbySupport {
|
||||||
$capture = $false
|
$count = 0
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$null = switch -Regex (powercfg /a) {
|
switch -Regex (powercfg /a) {
|
||||||
'The following sleep states are available on this system:' {
|
':' {
|
||||||
$capture = $true
|
$count += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
'^\s{2,4}(Standby \(S0 Low Power Idle\))' {
|
'(.*S0.{1,}\))' {
|
||||||
if($capture){
|
if ($count -eq 1) {
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
'The following sleep states are not available on this system:' {
|
|
||||||
$capture = $false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Error: Unable to check for S0 Modern Standby support, powercfg command failed" -ForegroundColor Red
|
Write-Host "Error: Unable to check for S0 Modern Standby support, powercfg command failed" -ForegroundColor Red
|
||||||
Write-Output ""
|
Write-Host ""
|
||||||
Write-Output "Press any key to continue..."
|
Write-Host "Press any key to continue..."
|
||||||
$null = [System.Console]::ReadKey()
|
$null = [System.Console]::ReadKey()
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user