Showing results for Advanced Functions - PowerShell Team

Dec 23, 2008
0
0

PowerShell V2: ParameterSets

PowerShell Team
PowerShell Team

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 of how...

CTP3Advanced Functions
Dec 23, 2008
0
0

Dreaming In PowerShell V2 : Lottery Numbers with Get-Random

PowerShell Team
PowerShell Team

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 asserts...

CTP3Advanced FunctionsGet-Random
Oct 17, 2008
0
0

Emit-XML

PowerShell Team
PowerShell Team

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 can ...

CTP3Advanced FunctionsEmit-Xml