Are you searching to parse the windowsupdate.log file, the following function is here to help! It will either parse the windowsupdate.log file from your default location, or you can specify an external one.

ps treasureN°2: Parsing WindowsUpdate.log

This time we will add this new function to our treasure chest that parses the windowsUpdate.log file and returns a nice and workable object. In the background it uses Regex to find the different informations, and group them in logical chunks of structured data.

In the end, you get an object that you can easily manipulate with PowerShell, and do some extensive parsing using the techniques that you are familiar with.

In case you are interested in learning the basic building blocks from regex, I recommend you read this article.

WindowsUpdate.Log file explained:

The windowsupdate.log file can look chaotic at first glance, but it Is actually a structured document. Simply there is a lot going on in it.

How to read the WindowsUpdate.log file?

Simply call the function provided here under as followed:

How to get the installed updates from the windowsupdate.log file?

How to filter the messages in the windowsupdate.log file by date?

The function is available here under:

Probably we can add more to this function, but for now, it answered my own needs. If you have any improvement suggests, please let me know in the comments 🙂

By | 2017-01-17T09:55:01+00:00 January 13th, 2017|regex, Treasure chest|1 Comment

About the Author:

Stéphane is a dynamic and passionate Cloud and datacenter Microsoft MVP since. He is the founder of the Basel PowerShell user Group (BPUG), the co-founder of the French Speaking PowerShell UserGroup (FRPSUG), author, blogger, and received the community award "PowerShell Hero" from Stéphane has implemented microsoft infrastructure solutions in various countries of Europe and is currently working in Basel / Switzerland. Stéphane help his clients to reduce their global infrastructure costs by implementing Microsft infrastructure solutions by combining great products such as System Center, Windows Server, with heavy automation using Windows PowerShell. Stéphane loves languages, Belgium beer, French cheese and French Wine. If any of these topics are of your interest, don't hesitate to come and say hi.

One Comment

  1. John January 17, 2017 at 6:11 pm - Reply

    I left a comment on the gist.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: