Control Windows with Windows PowerShell and WASP

Posted: March 17th, 2011 | Author: | Filed under: Uncategorized | 8 Comments »

Step 1: Install PowerShell
PowerShell 2.0 is included in Windows 7. If running any prior version, download and install Windows Management Framework Core from Microsoft support site http://support.microsoft.com/kb/968929

Step 2: Download Windows Automation Snapin for PowerShell at http://wasp.codeplex.com/ And Unzip WASP.zip to a Directory

Step 3: Change PowerShell Execution Policy
Go to Start->”Programs”->”Accessories”->”Windows PowerShell” Or just type “powershell” at the Run prompt.

Get the current execution policy:

 

To be able to run all scripts, including the unsigned ones (take your own risk!), change the PowerShellexecution policy from the default “Restricted” to “Unrestricted”.
To check the current execution policy, type

get-executionpolicy

at the PowerShell prompt.

To change the execution policy to “Unrestricted”, type

set-executionpolicy Unrestricted

Then do get-executionpolicy again to check that the policy has been changed

You may also read more on script signing by typing “get-help about_signing”.

Step 4: Start Windows PowerShell editor by “Start”->”Programs”-> “Accessories” ->”Windows PowerShell ISE”

Type the following text to the “Untitle1.ps1”.

Import-Module C:/install/WASP/wasp.dll

Select-Window | ft -auto

Then test it by clicking the “Run Script” button.