New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing newer OS versions #14
Comments
Currently there is no official way provided by Microsoft, which allows to determine Windows 11 by using the version numbers. According to the Operating System Version documentation, Windows 11 and Windows 10 (and Windows Server 2016 through Windows Server 2022) are having the same version number 10.0. It seems, that for Microsoft it is more like a "platform version". It might be because e.g. Windows 11 is just a marketing name and uses the basic system architecture of Windows 10. As far as I know, the distinction can currently only be made based on the build number, where e.g Windows 11 has a number with 22000 or higher. Nevertheless, the enums need an update regarding the Windows product names.
|
Here is how I reasoned about the version numbers on my side. Granted some of this may be inaccurate or unreliable, but it seems to work in the testing I did. public static OsVersionEnum GetVersionEnum()
{
var ver = (OSVersion.MajorVersion, OSVersion.BuildNumber, OSVersion.IsServer);
return ver switch
{
(< 10, _, false) => OsVersionEnum.PreWin10,
(< 10, _, true) => OsVersionEnum.PreWin2019,
(10, >= 22000, false) => OsVersionEnum.Win11,
(10, < 22000, false) => OsVersionEnum.Win10,
(10, >= 20000, true) => OsVersionEnum.Win2022,
(10, >= 17763, true) => OsVersionEnum.Win2019,
_ => OsVersionEnum.Unknown
};
} Note I only cared about a subset of OS versions in my business rules, so this switch expression is not comprehensive. |
This may be useful reference as well that I came across before: https://www.dell.com/support/kbdoc/en-gy/000193571/windows-11-incorrect-os-version-reported. |
Here is an interesting discussion that shows what developers or administrators would like to have regarding versioning and what Microsoft thinks about it. |
Hi, I wanted to see if this was still being worked on? Thanks |
Support for Windows 11 and Server 2022 have been added. #21 |
The OperatingSystem enum is missing a few:
The text was updated successfully, but these errors were encountered: