Some people have asked the question, "Why Cmdlets?". If you already have a reasonable API, what is the value in writing Cmdlets? I'll provide a quick answer here but we should probably include a good write up of this in our documentation.
The most important thing to realize about cmdlets is that it is all about mindset and attitude. The mindset of a cmdlet designer is that there is an "Admin at the keyboard" and the attitude is "we are going to do whatever it takes to provide that person an optimal user experience". The entire PowerShell engine is designed to make it easy for people to succeed at doing just that. There are times when cmdlets are very thin wrappers on top of APIs but if that is the case, the wrapper is doing all the critical things necessary to provide an optimal experience for Admins at keyboards.
Let's get specific about the differences. Here is a quick core dump off the top of my head. There are probably more but this is a good start:
Exchange 2007 has gone as far as to make Cmdlets be their only management interface and they do not expose an API at all. This allows them to leverage PowerShell as an SDK, to provide common security model and logging services and in the future it will provide them a single common remoting service.
In V2 – the gap between Cmdlets and APIs is going to grow MUCH larger. There will be important functions that will only be available to Cmdlets.
Cmdlets are designed for Admins at keyboards while APIs are not. Cmdlets are the very heart and soul of PowerShell.
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx