PowerShell Team

Automating the world one-liner at a time…

PowerShell V2: ParameterSets

One of the great benefits of PowerShell V2 Advanced Functions is the ease in which you can support parametersets.  ParameterSets are, well, different SETS of valid parameters.  For instance you can say: Get-Process -id 0 Get-Process -Name *ss Those are 2 different parametersets for the Get-Process cmdlet.  Here is an example ...

Dreaming In PowerShell V2 : Lottery Numbers with Get-Random

Tobias Weltner writes a blog called Dreaming In PowerShell, and he recently posted a way to get a list of unique lottery numbers with PowerShell.  Dreaming In PowerShell is a cool blog, and the post is interesting, but it makes an assertion that's no longer true in V2.  He uses System.Random to create the random numbers because he ...

Emit-XML

I was writing a demo yesterday and needed a quick and dirty way to generate some XML so I wrote the function below.  This highlights a couple of changes that are coming up in CTP3 that I thought I would preview. 1) The keyword "cmdlet" is going away and we'll just have "function".  Notice that now you ...

Feedback usabilla icon