Using Tail with PowerShell

Yes from PowerShell 3.0 there is the ability to use the Tail parameter in Get-Content.
 
Details can be found here.
 
Say you wanted to look at a SQL 2016 default instance errorlog file based on a D drive you could use:

Get-Content  "D:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG" -Tail 10 –Wait

image1

Leave a Reply