PowerShell SDK

When you want to develop something for PowerShell or program something that uses Windows PowerShell you need to install the Windows Software Development Kit (SDK). This SDK includes DLLs that you can you can use.

I will sometimes use the term 'PowerShell SDK' but in fact it's just the Windows SDK. Don't forget this.

Installing PowerShell SDK

You can find the link to the download on this website in the Software-section.

If you install just want to have the PowerShell SDK you need to change some settings during the installation. If you have loads of free harddisk space you can just check all items or leave it default.

This is how the setup screen looks:

Installing Windows PowerShell SDK

Press Next until you see the window below, these are the settings if you just want to develop for PowerShell.

PowerShell SDK Settings

Now run through the installation like you normally would do.

PowerShell SDK Changes

If you install the Windows SDK you will see that your command prompt has been changed to something like this:

Command Prompt PowerShell SDK

Don't be afraid you can use your command prompt just like you did before.

Using the PowerShell SDK in C#

As you could see on the screenshot from the command prompt, our Windows SDK has been installed in our Program Files directory:

C:\Program Files\Microsoft SDKs\Windows\v6.1
		

When you want to use it in C# (CSharp) you need to add a reference to a file that can help you using PowerShell.

Place this in your Using Statements in C#:

using System.Management.Automation;
		

Your reference can be found here:

C:\Windows\assembly\System.Management.Automation
		

Now it's up to you to explore the MSDN help files. They are detailed enough to get you started!