mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-04-03 14:06:27 +00:00
28 lines
734 B
PowerShell
28 lines
734 B
PowerShell
# Check if this machine supports S0 Modern Standby power state. Returns true if S0 Modern Standby is supported, false otherwise.
|
|
function CheckModernStandbySupport {
|
|
$count = 0
|
|
|
|
try {
|
|
switch -Regex (powercfg /a) {
|
|
':' {
|
|
$count += 1
|
|
}
|
|
|
|
'(.*S0.{1,}\))' {
|
|
if ($count -eq 1) {
|
|
return $true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch {
|
|
Write-Host "Error: Unable to check for S0 Modern Standby support, powercfg command failed" -ForegroundColor Red
|
|
Write-Host ""
|
|
Write-Host "Press any key to continue..."
|
|
$null = [System.Console]::ReadKey()
|
|
return $true
|
|
}
|
|
|
|
return $false
|
|
}
|