disable hibernation
This commit is contained in:
@@ -42,6 +42,14 @@ If ( IsAdmin )
|
||||
Write-Output "Deleting all temp files not modified in ${OlderThan} day(s) from ${SysTemp}"
|
||||
ForEach ( $OldTempFile in $OldTempFiles ) { Remove-Item $OldTempFile -Force -Recurse -ErrorAction SilentlyContinue }
|
||||
}
|
||||
|
||||
## Turn off system hibernation if it's in use
|
||||
If ( Test-Path "${Env:SystemDrive}\hiberfil.sys" )
|
||||
{
|
||||
Write-Output "Turning off system hibernation"
|
||||
Try { Start-Process "powercfg" -ArgumentList "-h off" -Wait }
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
}
|
||||
}
|
||||
|
||||
## Only run this section if we don't have administrative privileges
|
||||
|
||||
Reference in New Issue
Block a user