PoshCode Archive  Artifact Content

Artifact 6349cab8f83bda0c5c2d196c9bc24d7a9cea22530b42aebc7e7a4d01a2461a6e:

  • File Show-EventLog.ps1 — part of check-in [4b5fb4d250] at 2018-06-10 13:41:24 on branch trunk — ############################################################################################# (user: Rob Sewell size: 1203)

# encoding: utf-8
# api: powershell
# title: Show-EventLog
# description: #############################################################################################
# version: 0.1
# type: function
# author: Rob Sewell
# license: CC0
# function: Show-EventLog
# x-poshcode-id: 4465
# x-archived: 2013-09-17T23:56:33
# x-published: 2013-09-12T10:59:00
#
# #
# NAME: Show-EventLog.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:06/08/2013
# #
# COMMENTS: Load function for Showing the windows event logs on a server
# 覧覧覧覧覧覧覧覧覧覧覧覧
#

  #############################################################################################
#
# NAME: Show-EventLog.ps1
# AUTHOR: Rob Sewell http://sqldbawithabeard.com
# DATE:06/08/2013
#
# COMMENTS: Load function for Showing the windows event logs on a server in Out-GridView
# 覧覧覧覧覧覧覧覧覧覧覧覧
# Define a server an event log the number of events and display
# pipe to this and then to out-gridview to only show Errors -      where {$_.entryType -match "Error"}

Function Show-EventLog ($Server,$log,$Latest)
{
Get-EventLog  -computername $server -log $log -newest $latest | Out-GridView
}