Depending on your Windows PC energy settings, your machine may go into standby or hibernate after some time even though you might be still running a lengthy script.
One way to ensure that Windows keeps running while your script is busy is to use the “presentation mode”. There is a tool you can use to enable and disable it. In PowerShell, run this:
This opens a window where you can check and control your current presentation settings. To automatically start and stop presentation mode, the command supports the parameters /start and /stop.
To ensure that Windows won’t hibernate while your script runs, place this in your first script line:
PS> presentationsettings /start
At the end of your script, turn off presentation mode like this:
PS> presentationsettings /stop
To verify the effect of both commands, run the command without parameter and check the top-most checkbox in the dialog.
ReTweet this Tip!
Not working -- presentationsettings: The term 'presentationsettings' is not recognized as a name of a cmdlet, function, script file, or executable program. Laptop. Win10 Home. PowerShell 5.1, 7.1
FYI - This feature will not work on Desktop PC's and is for use on Mobile Devices (laptops etc).
Powered by IDERA