Merge pull request #1458 from PowerShell/psedition_rename

Rename Desktop & Core PSEditions to WindowsPowerShell & PowerShellCore
This commit is contained in:
Manikyam Bavandla MSFT authored and GitHub committed 2016-07-21 15:29:00 -07:00
commit 042d1e99bb
8 files changed
+13 -21

No files matched your search

@@ -587,7 +587,7 @@ function ConvertFrom-SddlString
Begin Begin
{ {
# On CoreCLR CryptoKeyRights and ActiveDirectoryRights are not supported. # 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" $errorId = "TypeNotSupported"
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidArgument $errorCategory = [System.Management.Automation.ErrorCategory]::InvalidArgument
@@ -622,7 +622,7 @@ function ConvertFrom-SddlString
{ {
param($AccessMask, $Type) param($AccessMask, $Type)
if ($PSEdition -eq "Core") if ($PSEdition -eq "PowerShellCore")
{ {
## All the types of access rights understood by .NET Core ## All the types of access rights understood by .NET Core
$rightTypes = [Ordered] @{ $rightTypes = [Ordered] @{
Binary file not shown.
@@ -12542,7 +12542,7 @@ function Update-ModuleManifest
$ProcessorArchitecture, $ProcessorArchitecture,
[Parameter()] [Parameter()]
[ValidateSet('Desktop','Core')] [ValidateSet('WindowsPowerShell','PowerShellCore')]
[string[]] [string[]]
$CompatiblePSEditions, $CompatiblePSEditions,
@@ -14144,6 +14144,8 @@ function Test-MicrosoftCertificate
$AuthenticodeSignature $AuthenticodeSignature
) )
$result = $false
if($AuthenticodeSignature.SignerCertificate) if($AuthenticodeSignature.SignerCertificate)
{ {
try try
@@ -14157,10 +14159,11 @@ function Test-MicrosoftCertificate
} }
$SafeX509ChainHandle = [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::CertDuplicateCertificateChain($X509Chain.ChainContext) $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 function Test-ValidManifestModule
@@ -386,7 +386,7 @@ namespace Microsoft.PowerShell.Commands
/// </summary> /// </summary>
[Parameter] [Parameter]
[AllowEmptyCollection] [AllowEmptyCollection]
[ValidateSet("Desktop", "Core")] [ValidateSet("WindowsPowerShell", "PowerShellCore")]
[SuppressMessage("Microsoft.Performance", [SuppressMessage("Microsoft.Performance",
"CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")] "CA1819:PropertiesShouldNotReturnArrays", Justification = "Cmdlets use arrays for parameters.")]
public string[] CompatiblePSEditions 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. /// Linux -- All PS on Linux flavors. This may need to be subdivided based on compatibility between distros.
/// </remarks> /// </remarks>
#if !CORECLR #if !CORECLR
internal const string PSEditionValue = "Desktop"; internal const string PSEditionValue = "WindowsPowerShell";
#elif LINUX
internal const string PSEditionValue = "Linux";
#else #else
internal const string PSEditionValue = "Core"; internal const string PSEditionValue = "PowerShellCore";
#endif #endif
// Static Constructor. // Static Constructor.
@@ -71,7 +71,7 @@ namespace System.Management.Automation
/// <summary> /// <summary>
/// Allowed PowerShell Editions /// Allowed PowerShell Editions
/// </summary> /// </summary>
internal static string[] AllowedEditionValues = { "Desktop", "Core" }; internal static string[] AllowedEditionValues = { "WindowsPowerShell", "PowerShellCore" };
/// <summary> /// <summary>
/// helper fn to check byte[] arg for null. /// helper fn to check byte[] arg for null.
+1 -10
View File
@@ -20,15 +20,6 @@ Describe "PSVersionTable" {
} }
It "Should have the correct edition" -Skip:(!$IsCore) { It "Should have the correct edition" -Skip:(!$IsCore) {
$expected = $PSVersionTable["PSEdition"] | Should Be "PowerShellCore"
if ($IsLinux -Or $IsOSX) {
"Linux"
} elseif ($IsWindows) {
"Core"
} else {
throw [PlatformNotSupportedException]
}
$PSVersionTable["PSEdition"] | Should Be $expected
} }
} }