PowerShell Select-Object Details
Select-Object is a very powerful tool for any PowerShell user. Many PowerShell cmdlets return a LOT of information when executed. Select-Object makes it really easy to reduce the noise and only display those fields that are meaningful. See below: $events = get-eventlog system –newest 25 $events | select TimeGenerated,EntryType,Message The first command will store the most recent 25 entries from your system log in a variable called $events. The second command prints the contents of that variable, selecting only the TimeGenerated, EntryType and Message columns (you might want to pipe all of that into FL in order to make it more readable). Ok, so that’s made it easy for us to filter the results that get displayed on screen, but that’s not usually the problem with event logs (or at least, not the main problem). When you’re troubleshooting a problem, you probably want to filter the results to only show errors and warnings, then just display the relevant fields. Where-Object