Had a few questions recently regarding Windows 10 falling asleep during Post-installation tasks. The following will show you how to Export, Import & Set a Custom Power Plan for your Laptop and PC’s.
A power plan exported will only be able to work on a Laptop, If you export a power plan on a Desktop it will not work on a Laptop.
You will need read/write network share to import & export the power plan.
- On your preferred device open Control Panel > Hardware & Sound > Power Options.
- Choose ‘Create a Power Plan’
- Set a ‘Plan name’ and click next
. - Set ‘Put the computer to sleep’ to ‘Never’ Click Create. You might also want to change the display timeout and edit any other options you like.
- You will now see that your Power Plan has been set active.
- Open up Powershell ISE as Admin
- Type in the following .\powercfg.exe /l and play the script. It will now show you your Power Plans and the GUID numbers. Note your GUID.
- Now have your network share ready so that you can export it.
- Type in the following .\powercfg.exe /export ‘\\NAS\Share\NewPowerPlan.pow’da058e3d-041f-418f-bcce-50611d2870bd (GUID) Note;; A powerplan must be exported with the extension .pow otherwise it will not import.
- Now that you have exported your PowerPlan we need to import it and set as active.
- Open a New Script in the Powershell ISE
- Copy the following
.\powercfg.exe /import ‘\\NAS\Share\NewPowerPlan.pow’da058e3d-041f-418f-bcce-50611d2870bd
.\powercfg.exe /setactive da058e3d-041f-418f-bcce-50611d2870bd
you can test the import and set active by setting the standard powerplan and deleting the new one created using
‘powercfg.exe /delete da058e3d-041f-418f-bcce-50611d2870bd’ - You want to now save the script as ‘PowerPlanLaptop.ps1’ or any name you like and upload it to your KACE SDA. Library > Post Installation Tasks > Choose Action > Add Powershell
- Name the Task and choose your PowerPlan.ps1 script to upload and save the task.
- Create a Scripted Installation and test it. It should have no problem working.
I would suggest using it as the First or Second Post-Install task. I hope this helps.