Drew Furgiuele steps up with an improved version of Get-SQLErrorLog:
It doesn’t have to be so bad, though, because we can make it better. In my mind, my perfect error log cmdlet should:
- Be usable when a SQL Server instance is down, and
- Be relatively quick, and
- Parse error messages by number, severity, and state, and
- Incorporate date/time range filtering, and
- Return an object
What’s that, you say? You want to solve each of these and write our own, better cmdlet? I got you, fam. At the bottom of this blog post you’ll find my code, and you can skip ahead if you don’t care about the “hows” or “whys” of what you’ll be looking at.
Very nice work Drew did in putting this together.