Thursday, March 8, 2012

Cmdlet - Q & A

Reference : http://stackoverflow.com/questions/1111654/what-is-a-powershell-cmdlet

A PowerShell cmdlet is a compiled piece of .NET code, more precisely a single class if I am not mistaken. Cmdlets are kind of the "native" commands in PowerShell land, being able to handle object input and output as well as usually playing nice and well with the (object-based) pipeline.
Cmdlets have no direct representation in the file system, as they are not programs or similar. They exist solely within PowerShell. You can use the Get-Command cmdlet to query all available cmdlets, functions, etc.
You can write cmdlets with a .NET language, such as C#. With PowerShell v2 there is also the possibility to write so-called advanced functions which behave similarly to cmdlets and have comparable capabilities but are interpreted PowerShell code, instead of compiled classes. This may incur a run-time overhead.

Useful Links:
===========
* Powershell Tutorials - Link
 http://www.powershellpro.com/powershell-tutorial-introduction/tutorial-powershell-cmdlet/

* Cmdlets overview - Link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395%28v=vs.85%29.aspx

* Tutorials for writing a cmdlet - Link
http://msdn.microsoft.com/en-us/library/windows/desktop/dd878321%28v=vs.85%29.aspx

* Commonly used cmdlets for Administrator - Link
http://www.computeranthem.com/powershell-20-tutorial-part-vi

* Reflector to view compiled code -
http://www.nivot.org/post/2008/10/30/ATrickToJumpDirectlyToACmdletsImplementationInReflector.aspx


Purpose :
Get list of all cmdlets available for PowerShell (PS) -  Link
http://technet.microsoft.com/library/ee176842.aspx

No comments:

Post a Comment