Kai
Kai

Reputation: 155

How to get OS Build number in Windows 10 1809 ISO using Powershell

We will get the OS Build number every time we build an OS. However I cant find where is the OS Build number inside the windows ISO file. I tried to search from the install.wim but cannot find it. I might miss something. Please let me know where can i get that number.

Example of OS Build number : 18362.239

enter image description here

Upvotes: 1

Views: 8692

Answers (3)

Nuno André
Nuno André

Reputation: 5359

An ISO file typically comes with several Windows images.

To get the build of, say, the first image of an ISO mounted on D: (images list is 1-indexed):

(get-windowsimage -imagepath "D:\sources\install.wim" -index 1).build

Upvotes: 0

Simon B
Simon B

Reputation: 218

Why not use DISM?

dism /Get-WimInfo /WimFile:X:\sources\install.wim

Then if you look at the created date (e.g. If the created date is: 3/19/2017 then the build number is the "1703" = Year & Month of Windows 10 release) or look at the build number

Upvotes: 0

Sid
Sid

Reputation: 2676

So what you have there is [OS build number].[Updated Build Revision (UBR) number]. You can get UBR by querying registry. That is the only way i know of.

(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name UBR).UBR

To get the OS build, you can use the WMI class or registry method.

(get-wmiobject -Class win32_OperatingSystem).BuildNumber

or

(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name CurrentBuild).CurrentBuild

or

[system.environment]::osversion.version.build

Or from the sysinfo which would be messy.

Now its just a matter of marrying the 2.

Upvotes: 2

Related Questions