Accessing Event Logs via Conversion

You will find that type conversion can do amazing things. For example, the next line accesses a system log by converting the log name to an EventLog object:

[System.Diagnostics.EventLog]"System"

Twitter This Tip! ReTweet this Tip!


Posted Sep 08 2010, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.