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 e179118c24..908e248e93 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 @@ -464,7 +464,7 @@ function GetResolvedPathHelper function Add-CompressionAssemblies { - if ($PSEdition -eq "WindowsPowerShell") + if ($PSEdition -eq "Desktop") { Add-Type -AssemblyName System.IO.Compression Add-Type -AssemblyName System.IO.Compression.FileSystem 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 7a5f06360e..2328d1dc91 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 "PowerShellCore" -and ($Type -eq "CryptoKeyRights" -or $Type -eq "ActiveDirectoryRights")) + if ($PSEdition -eq "Core" -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 "PowerShellCore") + if ($PSEdition -eq "Core") { ## All the types of access rights understood by .NET Core $rightTypes = [Ordered] @{ diff --git a/src/Modules/Shared/PowerShellGet/PSModule.psm1 b/src/Modules/Shared/PowerShellGet/PSModule.psm1 index 3bf44f236c..ed6449f934 100644 --- a/src/Modules/Shared/PowerShellGet/PSModule.psm1 +++ b/src/Modules/Shared/PowerShellGet/PSModule.psm1 @@ -12545,7 +12545,7 @@ function Update-ModuleManifest $ProcessorArchitecture, [Parameter()] - [ValidateSet('WindowsPowerShell','PowerShellCore')] + [ValidateSet('Desktop','Core')] [string[]] $CompatiblePSEditions, @@ -14147,8 +14147,6 @@ function Test-MicrosoftCertificate $AuthenticodeSignature ) - $result = $false - if($AuthenticodeSignature.SignerCertificate) { try @@ -14162,11 +14160,10 @@ function Test-MicrosoftCertificate } $SafeX509ChainHandle = [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::CertDuplicateCertificateChain($X509Chain.ChainContext) - $result = [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::IsMicrosoftCertificate($SafeX509ChainHandle) - $SafeX509ChainHandle.Close() + return [Microsoft.PowerShell.Commands.PowerShellGet.Win32Helpers]::IsMicrosoftCertificate($SafeX509ChainHandle) } - return $result + return $false } function Test-ValidManifestModule diff --git a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 index 2e5e94a02d..52016fbb4e 100644 --- a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 +++ b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 @@ -433,7 +433,7 @@ namespace Microsoft.PowerShell.Diagnostics "@ -if ($psedition.ToLower() -eq "powershellcore") +if ($psedition.ToLower() -eq "core") { # Currently we only support these cmdlets as logman.exe is not working on Nano/Lot system. Export-ModuleMember Enable-PSTrace, Disable-PSTrace, Get-LogProperties, Set-LogProperties diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index e78a3d6d7b..b6fd098958 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("WindowsPowerShell", "PowerShellCore")] + [ValidateSet("Desktop", "Core")] [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 7a8ba3b8b6..396a402556 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -50,9 +50,11 @@ 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 = "WindowsPowerShell"; + internal const string PSEditionValue = "Desktop"; +#elif LINUX + internal const string PSEditionValue = "Linux"; #else - internal const string PSEditionValue = "PowerShellCore"; + internal const string PSEditionValue = "Core"; #endif // Static Constructor. diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index ea1fbc3c51..7a5dbe7bcb 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 = { "WindowsPowerShell", "PowerShellCore" }; + internal static string[] AllowedEditionValues = { "Desktop", "Core" }; /// /// 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 880fd241b4..7d2d5b5bb2 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -20,6 +20,6 @@ Describe "PSVersionTable" -Tags "CI" { } It "Should have the correct edition" -Skip:(!$IsCoreCLR) { - $PSVersionTable["PSEdition"] | Should Be "PowerShellCore" + $PSVersionTable["PSEdition"] | Should Be "Core" } }