Can you have too many Cmdlets?

So here I go again… I hit another roadblock and I would like your opinion. As I go through the Netapp OnTap SDK I’m finding a lot of duplication. At first I went the VMware path and was building one Cmdlet for every possible task. This methodology is heavily dependent upon the pipeline for usability sake. For example take the following…

So that’s all great right? Here’s my issue NetApp has several API’s for both Volumes and Aggregates that are identical. Well almost, they perform the same functions, but take different parameters. So would you rather have 25 cmdlets that perform very specific tasks? Or 10 slightly more complicated cmdlets? I’ll elaborate a little further…

etApp has two base storage allocation methods and aggregate, and a volume. For those of you who don’t know a Volume is what you would concider a traditional raid. An Aggregate is a logical unit that contains Flexible Volumes. They perform the same exact function, but maintain different usecases. Therefor the OnTap API treat’s them seperatley even when they are performing the same function. i.e.

Raid Validation:
The process of validating the integrity of a given unit.

As you can see they are identical in use, and indeed perform the same task. The rational for keeping them separate is simple. Per the OnTap API within the Start-NaAggrVerify Cmdlet the target is specified via an “aggregate” parameter. Likewise the Start-NaVolVerify has an identical parameter but named “Volume”. As you can see the simple approach is to keep them separate, but when you consider that there are at least four Cmdlets dealing with verification, and at least five API’s like it. The Cmdlet count quickly get’s bloated and confusing (or at least I think it does). The alternative is to add a param and require more from the admin at runtime. Ala

On the one hand I personaly do not like this approach because it leads to an obscure and misleading syntax, but it is the only way I know to prevent “cmdlet sprawl”. So what do you think is it okay to require one or three extra parameters per, or would you rather see separate perpouse built cmdlets? Keep in mind I’ve only converted Volumes, Aggregates, licenses, Disks, and Snapshots. That is a total of five out of 40+ regions and I’ve already amassed some 46 cmdlets!

Is there such thing as too many cmdlets?


And yes I know that all my code will break with ctp3… I would rather update it for the new syntax in dec. Then wait and be stuck in v1 fuctions, or code cmdlets!  😉

3 thoughts on “Can you have too many Cmdlets?”

  1. I’d personally rather have a bunch of cmdlets. It’s easier when you’re trying to find out how to do something.

    For example, if I want to know all the things I can do with say aggregates, I can easily do a get-help *aggregates to get a list of relevant cmdlets that will more quickly lead me to figure out how I can do whatever I want with aggregates.

    At the very least, I’d make aliases to make the volumes and aggregate commands to point to the same thing.

    Great work though! Can’t wait to see how it turns out!

  2. Check out if powershell supports method overloading – I assume it does as the underlying the language commandlets are written in (C#) does. If the methods do in fact do the same thing but just take a different method signature, method overloading will simplify your API and take the different signatures. Win-win.

    P.S…told you that you would eventually cross into the developer side. Welcome. =)

  3. Hey, if you want to use that CodePlex PowerShellOnTAP project let me know and I’ll add you. I haven’t added any of the cmdlets I’ve created for it either lately. 😐


Leave a Reply