Script Download:  
The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

The goal of this script is to change the power button behavior in Windows 7.

Sometime users do not want to shut down the computer, and want the computer to sleep or hibernate. However, the default action in Power button "Shut down". This script is to change the power button behavior.

image image
 image

You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery