mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove ClrVersion property from $PSVersionTable (#4027)
* ClrVersion property of $PSVersionTable is not useful with CoreCLR and end users should not be using it that value to determine compatibility. Recommendation from dotnet team is to remove that property. * Removed internal members used for CLRVersion * removed CLRVersion from FullCLR build as well * added additional information to run `start-psbootstrap -buildnative` if cmake is not found
This commit is contained in:
+2
-2
@@ -190,7 +190,7 @@ function Start-PSBuild {
|
||||
|
||||
if ($IsWindows) {
|
||||
# cmake is needed to build powershell.exe
|
||||
$precheck = $precheck -and (precheck 'cmake' 'cmake not found. Run Start-PSBootstrap. You can also install it from https://chocolatey.org/packages/cmake')
|
||||
$precheck = $precheck -and (precheck 'cmake' 'cmake not found. Run "Start-PSBootstrap -BuildNative". You can also install it from https://chocolatey.org/packages/cmake')
|
||||
|
||||
Use-MSBuild
|
||||
|
||||
@@ -213,7 +213,7 @@ function Start-PSBuild {
|
||||
|
||||
} elseif ($IsLinux -or $IsOSX) {
|
||||
foreach ($Dependency in 'cmake', 'make', 'g++') {
|
||||
$precheck = $precheck -and (precheck $Dependency "Build dependency '$Dependency' not found. Run Start-PSBootstrap.")
|
||||
$precheck = $precheck -and (precheck $Dependency "Build dependency '$Dependency' not found. Run 'Start-PSBootstrap -BuildNative'.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace System.Management.Automation
|
||||
internal const string PSEditionName = "PSEdition";
|
||||
internal const string PSGitCommitIdName = "GitCommitId";
|
||||
internal const string PSCompatibleVersionsName = "PSCompatibleVersions";
|
||||
internal const string PSCLRVersionName = "CLRVersion";
|
||||
internal const string PSPlatformName = "Platform";
|
||||
internal const string PSOSName = "OS";
|
||||
internal const string SerializationVersionName = "SerializationVersion";
|
||||
@@ -71,10 +70,8 @@ namespace System.Management.Automation
|
||||
s_psVersionTable[PSVersionInfo.WSManStackVersionName] = GetWSManStackVersion();
|
||||
s_psVersionTable[PSPlatformName] = Environment.OSVersion.Platform.ToString();
|
||||
#if CORECLR
|
||||
s_psVersionTable[PSCLRVersionName] = null;
|
||||
s_psVersionTable[PSOSName] = Runtime.InteropServices.RuntimeInformation.OSDescription.ToString();
|
||||
#else
|
||||
s_psVersionTable[PSCLRVersionName] = Environment.Version;
|
||||
s_psVersionTable[PSOSName] = Environment.OSVersion.ToString();
|
||||
#endif
|
||||
}
|
||||
@@ -162,14 +159,6 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
internal static Version CLRVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Version)GetPSVersionTable()[PSCLRVersionName];
|
||||
}
|
||||
}
|
||||
|
||||
internal static Version[] PSCompatibleVersions
|
||||
{
|
||||
get
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Describe "PSVersionTable" -Tags "CI" {
|
||||
It "Should have version table entries" {
|
||||
$PSVersionTable.Count | Should Be 10
|
||||
$PSVersionTable.Count | Should Be 9
|
||||
}
|
||||
|
||||
It "Should have the right version table entries" {
|
||||
@@ -8,7 +8,6 @@ Describe "PSVersionTable" -Tags "CI" {
|
||||
$PSVersionTable.ContainsKey("PSEdition") | Should Be True
|
||||
$PSVersionTable.ContainsKey("WSManStackVersion") | Should Be True
|
||||
$PSVersionTable.ContainsKey("SerializationVersion") | Should Be True
|
||||
$PSVersionTable.ContainsKey("CLRVersion") | Should Be True
|
||||
$PSVersionTable.ContainsKey("PSCompatibleVersions") | Should Be True
|
||||
$PSVersionTable.ContainsKey("PSRemotingProtocolVersion") | Should Be True
|
||||
$PSVersionTable.ContainsKey("GitCommitId") | Should Be True
|
||||
|
||||
Reference in New Issue
Block a user