diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 02103d2850..81df0316e9 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -25,11 +25,7 @@ namespace System.Management.Automation { get { -#if CORECLR return RuntimeInformation.IsOSPlatform(OSPlatform.Linux); -#else - return false; -#endif } } @@ -40,11 +36,7 @@ namespace System.Management.Automation { get { -#if CORECLR return RuntimeInformation.IsOSPlatform(OSPlatform.OSX); -#else - return false; -#endif } } @@ -55,11 +47,7 @@ namespace System.Management.Automation { get { -#if CORECLR return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); -#else - return true; -#endif } } @@ -70,11 +58,7 @@ namespace System.Management.Automation { get { -#if CORECLR return true; -#else - return false; -#endif } } @@ -85,9 +69,7 @@ namespace System.Management.Automation { get { -#if !CORECLR - return false; -#elif UNIX +#if UNIX return false; #else if (_isNanoServer.HasValue) { return _isNanoServer.Value; } @@ -117,9 +99,7 @@ namespace System.Management.Automation { get { -#if !CORECLR - return false; -#elif UNIX +#if UNIX return false; #else if (_isIoT.HasValue) { return _isIoT.Value; } @@ -142,7 +122,6 @@ namespace System.Management.Automation } } -#if CORECLR /// /// True if it is the inbox powershell for NanoServer or IoT. /// @@ -173,8 +152,6 @@ namespace System.Management.Automation private static bool? _isNanoServer = null; private static bool? _isIoT = null; private static bool? _isInbox = null; -#endif - #endif // format files @@ -380,7 +357,7 @@ namespace System.Management.Automation { //service accounts won't have permission to create user folder return GetTemporaryDirectory(); - } + } } return Path.Combine(xdgcachehome, "powershell"); @@ -451,15 +428,15 @@ namespace System.Management.Automation if (!System.IO.Directory.Exists(folderPath)) { folderPath = null; } break; case System.Environment.SpecialFolder.Personal: - folderPath = envHome; + folderPath = envHome; break; case System.Environment.SpecialFolder.LocalApplicationData: folderPath = System.IO.Path.Combine(envHome, ".config"); - if (!System.IO.Directory.Exists(folderPath)) + if (!System.IO.Directory.Exists(folderPath)) { try { - System.IO.Directory.CreateDirectory(folderPath); + System.IO.Directory.CreateDirectory(folderPath); } catch (UnauthorizedAccessException) {