From 3b71bec9f3b4f55b2f7e4f71455f3c1bb6f74162 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 1 Aug 2017 00:06:51 +0400 Subject: [PATCH] Cleanup '#if CORE' in PSUserAgent.cs (#4403) --- .../commands/utility/WebCmdlet/PSUserAgent.cs | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs index 8b3911810..da3ccefec 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs @@ -130,15 +130,7 @@ namespace Microsoft.PowerShell.Commands { get { -#if CORECLR return System.Runtime.InteropServices.RuntimeInformation.OSDescription; -#else - OperatingSystem os = Environment.OSVersion; - string platform = GetOSName(os.Platform); - string formattedOS = string.Format(CultureInfo.InvariantCulture, - "{0} {1}.{2}", platform, os.Version.Major, os.Version.Minor); - return (formattedOS); -#endif } } @@ -149,32 +141,5 @@ namespace Microsoft.PowerShell.Commands return (CultureInfo.CurrentCulture.Name); } } - -#if !CORECLR - private static string GetOSName(PlatformID platformId) - { - string platform; - switch (platformId) - { - case PlatformID.Win32NT: // is this really the only valid option? - platform = "Windows NT"; - break; - case PlatformID.Win32Windows: - platform = "Windows"; - break; - case PlatformID.Win32S: - case PlatformID.WinCE: - case PlatformID.Xbox: - case PlatformID.MacOSX: - case PlatformID.Unix: - default: - // TODO: should we be doing something more robust here? - platform = platformId.ToString(); - break; - } - - return (platform); - } -#endif } }