Restart required

by May 23, 2011

Check out this line to determine when an installation required a system restart:

Get-EventLog -InstanceId 1038 -LogName Application |
ForEach-Object { $i=1|Select-Object Date,Product,Version,Company;`
$i.Date = $_.TimeWritten $i.Product,$i.Version,`
$i.Company =  $_.ReplacementStrings[0,1,5] $i }

It will return an exception if no such events are found. Otherwise, you will get a listing with the dates and the products that required a system restart.


Twitter This Tip!
ReTweet this Tip!