1

I am using Visual Studio 2010 Ultimate Beta 2. What is the relevant namespace/classes for creating a PowerShell cmdlet in C#?

I assume there is an interface or abstract class to derive from.

1 Answer 1

2

You'll need to derive from System.Management.Automation.Cmdlet.

It lives in system.management.automation.dll. If you're on Windows Vista or newer, the file's in your GAC, which can be referenced but it's tricky. It's probably easiest to install the PowerShell SDK, and then you can reference the assembly directly from "Add Reference..." in Visual Studio. (Full path is C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.