Register
: :
Login
Home
Forums
Blogs
Podcast
Directories
Scripts
Downloads
Community
User Group Support
Learning Resources
We have a new sponsor! Introducting
Pragma Systems
. See the home page for details.
Unanswered
Active Topics
Forums
Search
Members
Forums
>
PowerShell Development
>
Cmdlet Development
cmdlet development in other than C# and VB
Last Post 30 Jun 2009 05:20 PM by
Poshoholic
. 5 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
chris.1234.ny
New Member
Posts:5
29 Jun 2009 05:30 AM
Hi Guys
I want to know if it is possible to create a cmdlet in any language other than C# or VB.
Is it possible to develop in powershell itself?
Thanks
Chris
Shay
Veteran Member
Posts:1136
29 Jun 2009 07:36 AM
Answered here:
http://www.powershellcommunity.org/Forums/tabid/54/aff/1/aft/3991/afv/topic/afpgj/1/Default.aspx#5485
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Community Toolbar
Twitter:
@ShayLevy
marco.shaw
Site Moderator
Advanced Member
Posts:653
29 Jun 2009 04:46 PM
Can you be more specific on what you might want to do?
You're hoping to do something in C, for example? Apparently you can do .NET programming in C, but I'm not experience enough to know if this can be extended to PowerShell and whether there may be limitations.
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com
chris.1234.ny
New Member
Posts:5
29 Jun 2009 10:47 PM
I want to develop commandlets that would make WMI calls to get some disk management tasks. Since there is a good support for WMI in powershell, I was thinking of doing things in powershell itself.
marco.shaw
Site Moderator
Advanced Member
Posts:653
30 Jun 2009 02:04 AM
Well, you have a few options with WMI... You can use the PowerShell API, or make your own direct calls to either WMI via managed code or through COM.
For example, Hyper-V is managed completely via a WMI API...
Marco
*Microsoft MVP - Windows PowerShell
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition
*Blog - http://marcoshaw.blogspot.com
Poshoholic
PowerShell MVP
New Member
Posts:94
30 Jun 2009 05:20 PM
Chris,
Wrapping WMI calls in PowerShell functions (or in advanced functions in v2) is a great practice. Using Marco's Hyper-V example, in the Hyper-V PowerPack for PowerGUI I have written over 30 functions to make working with Hyper-V as easy as working with any well designed cmdlet. Those functions are all visible in PowerGUI so you can feel free to take a look and see how I do that today using v1.
Actually, so far I have stuck with my decision to write any extension I write for PowerShell in PowerShell itself. That has helped me learn how the language works and I still take that approach today. So far this has been exclusively using functions in PowerShell v1, and while v1 functions are not quite the same as cmdlets you can do a ton with them and get the same experience as you get when working with cmdlets. I'll be converting those functions over to advanced functions for the next little while and that will make them be a little closer to the cmdlet experience. Plus using functions gives people access to source code, lets them step through it and find and report bugs, etc, making it more of a community effort. I highly recommend it.
Kirk Munro [
MVP
]
Poshoholic
My blog:
http://poshoholic.com
Follow me on Twitter:
http://twitter.com/poshoholic
You are not authorized to post a reply.
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
Forums
>
PowerShell Development
>
Cmdlet Development
Active Forums 4.1
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008