Getting Windows 2008 R2 ready for PowerShell development

by Klaus Graefensteiner 15. February 2011 23:09

Introduction

On a fresh install of Windows 2008 R2 there are four commands that you might want to run to get the computer prepared for developing and testing PowerShell scripts. This blog post tells you what these four commands are and how to execute them.

Step 0: Run PowerShell As Administrator

Since the following commands will require administrator privileges start the PowerShell console as Administrator. Right click on the PowerShell icon on the taskbar and choose the Run As Administrator command.

001 - Start PowerShell and Run As Administrator

Figure 1: Run PowerShell console as Administrator

Step 1: Enable execution of un-signed local scripts

Now type  Set-ExecutionPolicy remotesigned  to enable the execution of un-singed scripts that didn’t get downloaded via Internet Explorer or Outlook. Confirm with y for yes.

Step 2: Enable PowerShell Remoting

Next type  Enable-PSRemoting to enable PowerShell remoting. Confirm with y for yes, when being prompted.

002 - ScriptPolicy and PSRemoting

Figure 2: Set the script execution policy and enable PowerShell Remoting

Step 3: Install the PowerShell ISE

On Windows 2008 R2 Server the PowerShell Integrated Scripting Environment ISE tool is not installed by default, but needs to be added as a Windows Feature. This is a two step process.

First import the Server Manager module that contains a cmdlet for adding Windows Features.

Type Import-Module ServerManager

003 - Import ServerManager module and add PowerShell-ISE feature

Figure 3: Import the Server Manager module and install the PowerShell ISE

Once the Server Manager module has been imported successfully type:

Type Add-WindowsFeature PowerShell-ISE

Note: The minus letter instead of the underscore is not a typo.

004 - PowerShell ISE installed

Figure 4: The PowerShell ISE installation was successfull

Ready, Steady, Go PowerShell

Run the PowerShell ISE and start developing PowerShell scripts.

005 - PowerShell ISE

Figure 5: PowerShell ISE in action

Tags: , , ,

PowerShell

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2013, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2013 by Klaus Graefensteiner

Rendertime:
Page rendered at 5/23/2013 2:04:00 AM (PST Pacific Standard Time UTC DST -7)