From 81e5a7e7aaacf0433a5363789d80d2b673e17db5 Mon Sep 17 00:00:00 2001 From: Manikyam Bavandla Date: Wed, 20 Jul 2016 18:30:21 -0700 Subject: [PATCH] Update PSEdition values to Rename Desktop & Core to WindowsPowerShell and PowerShellCore $PSVersionTable.PSEdition currently supports Desktop and Core enums. Because PowerShell is going to be Open and also available on Linux/Mac from August, we decided to rename these values so as to make it clear to the end user. We decided to use the names WindowsPowerShell,PowerShellCore. --- .../Microsoft.PowerShell.Archive.psm1 | Bin 105436 -> 105456 bytes .../Microsoft.PowerShell.Utility.psm1 | 4 ++-- .../Shared/PSDiagnostics/PSDiagnostics.psm1 | Bin 23642 -> 23662 bytes .../Shared/PowerShellGet/PSModule.psm1 | 9 ++++++--- .../Modules/NewModuleManifestCommand.cs | 2 +- .../engine/PSVersionInfo.cs | 6 ++---- .../engine/Utils.cs | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 b/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 index bb645b27bb79780bc8e9e8037a770968a9ec5dfc..e3c4ac173ac408f5f98322c1ac6b53fbf7d62707 100644 GIT binary patch delta 48 zcmcb!o$bSRwhbv;6vG)Z8S)rX81fm)8HyPKz;r4@5koLT216=C4nxl7!Y$d)0ftKt AN&o-= delta 34 qcmeyco$bzcwhbv;_+1!M8HyRQ8A=%P844JbCU1PKx_QkOm*)WKo(-e` diff --git a/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 b/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 index 2328d1dc91..7a5f06360e 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 @@ -587,7 +587,7 @@ function ConvertFrom-SddlString Begin { # On CoreCLR CryptoKeyRights and ActiveDirectoryRights are not supported. - if ($PSEdition -eq "Core" -and ($Type -eq "CryptoKeyRights" -or $Type -eq "ActiveDirectoryRights")) + if ($PSEdition -eq "PowerShellCore" -and ($Type -eq "CryptoKeyRights" -or $Type -eq "ActiveDirectoryRights")) { $errorId = "TypeNotSupported" $errorCategory = [System.Management.Automation.ErrorCategory]::InvalidArgument @@ -622,7 +622,7 @@ function ConvertFrom-SddlString { param($AccessMask, $Type) - if ($PSEdition -eq "Core") + if ($PSEdition -eq "PowerShellCore") { ## All the types of access rights understood by .NET Core $rightTypes = [Ordered] @{ diff --git a/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 index bc893f13db11cb01d070e736661007ced98cc6a1..daa28aed02e86cb7a83ce5c258e4ab8c044ea049 100644 GIT binary patch delta 34 ocmcb$gYn%C#tp9`gbNt*8Oj+_8HyN+88U!$4nxl7ml1``0O!gJ?EnA( delta 14 WcmaF2gYni5#tp9`Hvfw#U [Parameter] [AllowEmptyCollection] - [ValidateSet("Desktop", "Core")] + [ValidateSet("WindowsPowerShell", "PowerShellCore")] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")] public string[] CompatiblePSEditions diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 92aaee14eb..a6c3c31629 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -47,11 +47,9 @@ namespace System.Management.Automation /// Linux -- All PS on Linux flavors. This may need to be subdivided based on compatibility between distros. /// #if !CORECLR - internal const string PSEditionValue = "Desktop"; -#elif LINUX - internal const string PSEditionValue = "Linux"; + internal const string PSEditionValue = "WindowsPowerShell"; #else - internal const string PSEditionValue = "Core"; + internal const string PSEditionValue = "PowerShellCore"; #endif // Static Constructor. diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index d5b29ad010..13dcbe63b3 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -71,7 +71,7 @@ namespace System.Management.Automation /// /// Allowed PowerShell Editions /// - internal static string[] AllowedEditionValues = { "Desktop", "Core" }; + internal static string[] AllowedEditionValues = { "WindowsPowerShell", "PowerShellCore" }; /// /// helper fn to check byte[] arg for null.