I want exactly the same output as winver
only on the command line. For example, on my machine running winver
returns this:
I need a command line alternative that would return 1909. I know how to get the 18363 piece - [environment]::OSVersion.Version.Build
(in powershell). Googling reveals several options, none of which tell me that the version is 1909:
wmic os get
systeminfo
Now maybe they encode it differently, I do not know. Ideally I want to get the Version and the OS Build.
EDIT 1
I am OK to read it from registry, since it can be done on the command line.
EDIT 2
Thanks to a hint from dxiv I found it:
(get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseId