Feb 10

Tail event logs in PowerShell

Lately I have been working on scripting for a lot of different products. While doing so, I decided to try incorporating William Lam’s scripts for automating the vCAC 6 IAAS server.

I already had my own scripts that did the vCAC6 Pre-req automation and a personal script that automated the install of SQL server. So between what I already had, and part of what William had created, I set out to do a little more automation. However, I ran into some issues when running William’s script. I realized it was something I had done since others had said that his script worked great (yes, I did edit past the ‘DO NOT EDIT BELOW THIS POINT’ comment…)

The issue arose when installing the DEM worker, agents, and vCAC Database. I decided I wanted to Tail the log that was being created to see what was going on in real-time. In Linux, tailing a log is easy, but I had never done this in Windows before, a quick google search led me to an ‘almost as easy’ solution. If you know where the log file is created, open a PowerShell session and type:

This will enable you to watch in real-time as the logfile gets updated. By using this I was able to see at what point I had messed up the original install script and tweaked it to where it worked again. It’s much easier to tail the log than have to go into a logfile with thousands of lines of code and search for issues after the fact.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

15 − four =