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 bb645b27bb..e3c4ac173a 100644 Binary files a/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 and b/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 differ 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 bc893f13db..daa28aed02 100644 Binary files a/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 and b/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 differ diff --git a/src/Modules/Shared/PowerShellGet/PSModule.psm1 b/src/Modules/Shared/PowerShellGet/PSModule.psm1 index d18d966c02..68b07fe80b 100644 --- a/src/Modules/Shared/PowerShellGet/PSModule.psm1 +++ b/src/Modules/Shared/PowerShellGet/PSModule.psm1 @@ -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 diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index b6fd098958..e78a3d6d7b 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs @@ -386,7 +386,7 @@ namespace Microsoft.PowerShell.Commands /// [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. diff --git a/test/powershell/Host/PSVersionTable.Tests.ps1 b/test/powershell/Host/PSVersionTable.Tests.ps1 index ea414f1410..4725973a10 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -20,15 +20,6 @@ Describe "PSVersionTable" { } It "Should have the correct edition" -Skip:(!$IsCore) { - $expected = - if ($IsLinux -Or $IsOSX) { - "Linux" - } elseif ($IsWindows) { - "Core" - } else { - throw [PlatformNotSupportedException] - } - - $PSVersionTable["PSEdition"] | Should Be $expected + $PSVersionTable["PSEdition"] | Should Be "PowerShellCore" } }