Home » PowerShell » Restart required

Restart required


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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: