Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
Get-SqlErrorLog is designed to quickly retrieve data from SQL Server error logs, negating the slowness of SSMS and awkwardness of manually crawling files.
.DESCRIPTION
Get-SqlErrorLog is designed to quickly retrieve data from SQL Server error logs, negating the slowness of SSMS and awkwardness of manually crawling files.
It is designed to be quite light in it's process, and should be quick (loading SQLPLS being the exception.
Function Convert-Size {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[Alias("Length")]
[int64]$Size
)
Begin {
If (-Not $ConvertSize) {