Public/Disable-Standby.ps1
function Disable-Standby { <# .DESCRIPTION Disables standby, sleep, and hibernate .EXAMPLE Disable-Standby .Link https://github.com/TheTaylorLee/PCSetup #> [CmdletBinding()] [Alias("Disable-Sleep")] param ( ) Write-Host "Creating Power Scheme Standby Off!" -ForegroundColor Green #Get Path to Powercfg $getmod = Get-Module AdminToolbox $trim = $getmod.path -replace ("AdminToolbox.psm1", "") $Modpath = $trim + 'support' #Import Powercfg powercfg.exe /import $Modpath\StandbyOff.pow b65fca42-8671-46eb-8e87-953a344161dd #Set PowerConfig powercfg.exe /SETACTIVE b65fca42-8671-46eb-8e87-953a344161dd #Remove Hiberfile if possible Remove-Item c:\hiberfile.sys -Force -ErrorAction SilentlyContinue } |