0
Vote

Modify functions to use patterns & practices

description

Some example:
 
For cmdlets that handle persisted objects:
Use only - Get, Set, New, and Remove verbs
 
Get cmdlet can retrieve one or more objects.  If no parameters are specified, Get cmdlet should return all available instances of the object.
There are three [optional] parameters:
-Identity:  returns the object with the specified Identity value.  Should allow user to specify object identity such as GUID AND URL (use can send either).  Parameter should also accept partical string inputs like '*' where possible matches are returned.
-Filter: Typically for Cmdlets that return more than a 1000 items.  Limits results to those that match specified query expression.  Used for server-side queries only, client side should use Where-Object
-Limit: sets the maximum number of objects to be returned.  When limit is reached, user should see warning.  "ALL" should return all possible values
 
Cmdlet nonuns:  should be singluar and reflect the object that is returned  e.g.  Get-SPSite   (instead of Get-SPSites). 
Use prefixes & suffixes to indicate value property:  MaxConnectionTimeOut   or SiteBandwidthLimit
 
Cmdlets should also have a supporting help entry (more on this later).
 
 
More patterns & practices details later...but this is a rough idea of how the cmdlets should be built.

comments