The install PowerShell on a version of Windows before Windows 7 (Windows Server 2k3, 2k8, Vista, or XP), visit the Windows Management Framework download page. This download includes Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0. For those interested, you can also download just WinRM and PowerShell at that link as well.
Note : If you are using Windows 7, PowerShell is already installed.
Running and Configuring PowerShell
PowerShell out of the box does not allow scripts to be ran. You will need to run PowerShell and set the Execution Policy.
- Start PowerShell
- Type Set-ExecutionPolicy (Do not hit enter yet)
- Enter one of the following after the Set-ExecutionPolicy
- Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode.
- AllSigned – Only scripts signed by a trusted publisher can be run.
- RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
- Unrestricted – No restrictions; all Windows PowerShell scripts can be run.
For Example, on my development machine in which I wanted full control, I typed
This should get you up and going. There will be a part 2 soon with simple scripts to get you started scripting. Stay tuned and happy scripting!