Quantcast
Channel: Powershell Box of Tricks – SQL DBA with A Beard
Viewing all articles
Browse latest Browse all 40

Displaying the Windows Event Log with PowerShell

$
0
0

The latest post in the  PowerShell Box of tricks series is here.

I’ll start by saying this is a bit of a cheat. PowerShell has a perfectly good cmdlet called Get-EventLog and plenty of ways to use it

I created this function because I like to use Out-GridView and specify only a few records so it is quicker on remote systems. I like Out-GridView as it enables me to filter easily by typing in the top box. This is most often used via the simple GUI I have created. At the command line I would just use Get-EventLog

image

The function is shown below. It is important to know that the $log parameter is CaSeSensItive

image

The Code is here Show-EventLog



Viewing all articles
Browse latest Browse all 40

Trending Articles