Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky committed Dec 30, 2022
1 parent 61f9c2d commit b710127
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ public static partial class PlatformDetection
public static bool IsWindows8xOrLater => IsWindowsVersionOrLater(6, 2);
public static bool IsWindows10OrLater => IsWindowsVersionOrLater(10, 0);
public static bool IsWindowsServer2019 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 17763;
public static bool IsWindowsNanoServer => IsWindows && (IsNotWindowsIoTCore && GetWindowsInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));
public static bool IsWindowsNanoServer
{
get
{
Console.WriteLine($"GetWindowsInstallationType(): {GetWindowsInstallationType()}");
Console.WriteLine($"GetWindowsProductType(): {GetWindowsProductType()}");
Console.WriteLine($"IsWindows: {IsWindows}");
Console.WriteLine($"IsNotWindowsIoTCore: {IsNotWindowsIoTCore}");
Console.WriteLine($"Environment.OSVersion.Version.Major: {Environment.OSVersion.Version.Major}");
Console.WriteLine($"Environment.OSVersion.Version.Minor: {Environment.OSVersion.Version.Minor}");
return IsWindows && (IsNotWindowsIoTCore && GetWindowsInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));
}
}
public static bool IsWindowsServerCore => IsWindows && GetWindowsInstallationType().Equals("Server Core", StringComparison.OrdinalIgnoreCase);
public static int WindowsVersion => IsWindows ? (int)GetWindowsVersion() : -1;
public static bool IsNotWindows7 => !IsWindows7;
Expand Down

0 comments on commit b710127

Please sign in to comment.