PowerShell Basics

Measure-Object

One cmdlet that I don’t think gets used enough is Measure-Object. This enables you to find the minimum, maximum, sum and average of a set of numbers...

read more

Using localhost

When creating functions that accept a computer name as a parameter you will often see this syntax   param ( [string]$computername = ‘localhost’...

read more

Filter vs Include

  I’ve gone through most of the Beginner event submissions over the last couple of days.  One thing that has jumped out is the potential...

read more

A switch in time

I’ve posted about the switch statement a number of times but it is one of those topics that keeps coming up. Imagine you have a variable that can...

read more

Random confusion

There seems to be a bit of cofusion about how Get-Random works. Try this 1..10 | foreach {Get-Random} you’ll get  randomly selected 32-bit...

read more

Write-Host Wrong!

Many scripting languages require you explicitly write out to screen – VBScript was an example. This leads to PowerShell that looks like this...

read more

Pipeline input

A question on the forum asked about creating a function that accepts pipeline input OR has a path parameter.  Means it can be used like this...

read more