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.
This commit is contained in:
Manikyam Bavandla
2016-07-20 18:30:21 -07:00
parent d66b303201
commit 81e5a7e7aa
7 changed files with 12 additions and 11 deletions
@@ -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] @{
Binary file not shown.
@@ -12542,7 +12542,7 @@ function Update-ModuleManifest
$ProcessorArchitecture,
[Parameter()]
[ValidateSet('Desktop','Core')]
[ValidateSet('WindowsPowerShell','PowerShellCore')]
[string[]]
$CompatiblePSEditions,
@@ -14144,6 +14144,8 @@ function Test-MicrosoftCertificate
$AuthenticodeSignature
)
$result = $false
if($AuthenticodeSignature.SignerCertificate)
{
try
@@ -14157,10 +14159,11 @@ function Test-MicrosoftCertificate
}
$SafeX509ChainHandle = [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::CertDuplicateCertificateChain($X509Chain.ChainContext)
return [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::IsMicrosoftCertificate($SafeX509ChainHandle)
$result = [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::IsMicrosoftCertificate($SafeX509ChainHandle)
$SafeX509ChainHandle.Close()
}
return $false
return $result
}
function Test-ValidManifestModule
@@ -386,7 +386,7 @@ namespace Microsoft.PowerShell.Commands
/// </summary>
[Parameter]
[AllowEmptyCollection]
[ValidateSet("Desktop", "Core")]
[ValidateSet("WindowsPowerShell", "PowerShellCore")]
[SuppressMessage("Microsoft.Performance",
"CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] CompatiblePSEditions
@@ -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.
/// </remarks>
#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.
@@ -71,7 +71,7 @@ namespace System.Management.Automation
/// <summary>
/// Allowed PowerShell Editions
/// </summary>
internal static string[] AllowedEditionValues = { "Desktop", "Core" };
internal static string[] AllowedEditionValues = { "WindowsPowerShell", "PowerShellCore" };
/// <summary>
/// helper fn to check byte[] arg for null.