Accessing a Property of All Objects in a PowerShell Array
If you've looked at the scripts that I've written, you may have noticed that I use a fairly simple bit of syntax whenever I need to access a single property from all objects in an array (in PowerShell). I just wrote that sentence and even I'm not entirely sure what it means, so I'd better use an example. Try this: $events = get-eventlog -newest 10 $events.source What output did you see? If you saw a list of 10 sources, congratulations, your PowerShell is at least version 3! If you saw no output, then you should really update your PowerShell. This is the functionality that I mean - the ability to easily generate an array of a single Property (in this case, Source) from an array of objects. I bring this up because that functionality is super useful. For example, I was recently writing a script for a customer that involved analyzing a bunch of AD Users and I needed to manipulate a single Property and then select users based on that Property (I'm ...