Advertisement

Find Your Windows Upgrade History with PowerShell

Every time you perform a build upgrade in Windows 10, the operating system stores some bits of information related to previously installed operating system versions in the Registry. By fetching this info, you can see a list of builds that you installed to come to the currently installed version of the OS. This can be really interesting, especially if you have upgraded your Windows 7 or 8.1 OS to Windows 10 and then joined the Windows Insider Preview program. The list can be very long.

Advertisеment


Here is a simple trick which will allow you to recall which versions of the OS you had installed on your computer. The information is stored under the following Registry keys:
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Source OS (extra info here)

Each Source OS* subkey describes a previously installed Windows version. See the following screenshot.Build Upgrade History In Registry

Walking through these subkeys can be interesting, but takes a lot of time. To perform it faster, there is a nice PowerShell snippet which will populate a table with previously installed builds of the OS.

To find Windows Upgrade history with PowerShell, do the following.

    1. Open an elevated PowerShell window.
    2. Copy-paste the following command:
      $AllBuilds = $(gci "HKLM:\System\Setup" | ? {$_.Name -match "\\Source\s"}) | % { $_ | Select @{n="UpdateTime";e={if ($_.Name -match "Updated\son\s(\d{1,2}\/\d{1,2}\/\d{4}\s\d{2}:\d{2}:\d{2})\)$") {[dateTime]::Parse($Matches[1],([Globalization.CultureInfo]::CreateSpecificCulture('en-US')))}}}, @{n="ReleaseID";e={$_.GetValue("ReleaseID")}},@{n="Branch";e={$_.GetValue("BuildBranch")}},@{n="Build";e={$_.GetValue("CurrentBuild")}},@{n="ProductName";e={$_.GetValue("ProductName")}},@{n="InstallTime";e={[datetime]::FromFileTime($_.GetValue("InstallTime"))}} };

      Press the Enter key.Build Upgrade History In PowerShell Command 1

    3. Now, execute the following:
      $AllBuilds | Sort UpdateTime | ft UpdateTime, ReleaseID, Branch, Build, ProductName

      The snippet produces a very neat output. On my Insider Preview machine, it shows the following:Build Upgrade History In PowerShell Command 2

The first command forms the contents of the $AllBuilds variable. The second command sorts it and fetches the required fields to show. It can be really interesting for Windows 10 users to view their feature update history.

For users who came to Windows 10 from a previous Windows version, the original setup verion will be mentioned as the first item in the list. Also, see the following article:

How to get Windows 10 installation date

The script is created by a reddit user "sizzlr". Via deskmodder.de.

What does the script show you? How long is your upgrade history? Share your experience in the comments!

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.