views:

444

answers:

4

Hi,

I'm learning some PowerShell. Is it possible to see the source code for a built-in cmdlet like Get-ChildItem?

+3  A: 

I do not believe that the source code for powershell has ever been released.

EBGreen
I doubt it will be, either.
alastairs
+1  A: 

You should be able to use Reflector to "see" the source code. You need to know the assembly though, but it should also accessible using the GetType method or similar.

This PowerShellLanguage .NET Reflector Add-In can perhaps be useful.

dalle
check out my updated answer, you don't need to know the assembly!
halr9000
+7  A: 
halr9000
+1  A: 

You might also like to take a look at Windows Installer PowerShell Snap-In on CodePlex, it's a smaller project than the community extensions so easier to get your head around whats going on.

Check out Professional Windows PowerShell Programming: Snapins, Cmdlets, Hosts and Providers (Wrox Professional Guides) ISBN: 0470173939 - it's one of the most useful books I've found for writing cmdlets and providers.

Stephen Harrison