Install the PowerShell ISE & Enable PowerShell Scripts

PowerShell 2.0 is installed by default on Windows 7 and Windows Server 2008 R2. The PowerShell ISE (Integrated Scripting Environment) is installed by default on Windows 7, but not Windows Server 2008 R2. You can use the following information to install the ISE on your 2008 R2 server (as long as it’s running the full GUI and not the Core installation).

Launch PowerShell and execute the following:

Import-Module ServerManager
Add-WindowsFeature PowerShell-ISE

ise1.png

If you attempted to run this on the Core (no GUI) installation of Windows Server 2008 R2, you would receive the following error:

ise2.png

The PowerShell ISE is now installed and can be accessed under the “Start>All Programs>Accessories>Windows PowerShell” Menu:

ise3.png

PowerShell scripts are disabled by default on both Windows 7 and Windows Server 2008 R2. Typing commands into the ISE and executing them will work, but once they are saved as a script, you will receive the following error when you attempt to execute it:

ScriptName.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.

ise4.png

Using the following command, the execution of scripts is set to “RemoteSigned” which requires that scripts downloaded from the Internet be signed by a trusted publisher:

Set-ExecutionPolicy RemoteSigned

ise5.png

The execution policy can be changed for a single session:

PowerShell.exe -ExecutionPolicy RemoteSigned

ise6.png

The execution policy can also be set via group policy. You can learn more about execution policies on Microsoft TechNet.

µ