$ErrorActionPreference='Continue' Write-Output '===== powercfg 当前方案 超时设置 =====' powercfg /query SCHEME_CURRENT SUB_SLEEP 2>&1 | Select-String 'GUID|当前|Current|索引|Index' | ForEach-Object { Write-Output $_.Line.Trim() } Write-Output '' Write-Output '--- 标准休眠/睡眠秒数(0=永不) ---' Write-Output ('Standby AC: ' + (powercfg /query SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 2>&1 | Select-String '当前交流电源设置|Current AC Power Setting').ToString()) Write-Output ('Hibernate AC: ' + (powercfg /query SCHEME_CURRENT SUB_SLEEP HIBERNATEIDLE 2>&1 | Select-String '当前交流电源设置|Current AC Power Setting').ToString()) Write-Output '' Write-Output '===== keepalive.ps1 / 不休眠exe 是否存在 =====' Write-Output ('C:\keepalive.ps1 : ' + (Test-Path 'C:\keepalive.ps1')) $exe = Get-ChildItem 'C:\Users\Administrator\Desktop','C:\' -Recurse -Filter '*不休眠*' -ErrorAction SilentlyContinue | Select-Object -First 3 -Expand FullName Write-Output ('不休眠exe: ' + ($exe -join '; '))