The script is available for download from https://gallery.technet.microsoft.com//How-to-find-out-what-woke-a1408069. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This PowerShell script sample shows how to get all info of power event to let users find out what woke up the computer and get the wake time.
You might have encountered your computer's waking up from sleep without any intervention from you, it's likely another program or device is waking it up. Users want to know what program wakes up the computer without any intervention. This script can help user to find out what woke it up last.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery