You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$PSVersionTable.CLRVersion property should be removed in PowerShell Core #1395
This is purposefully not set because it is supposed to be [Environment]::Version, but that is not available in .NET Core (at least not in the current stable release; it is coming back per dotnet/corefx@fe5f4fb, which will be available in the next stable release). So while it is not available, it is set to null.
Please note that the following will be confusing:
~/src/PowerShell |-/ [environment]::Version
Major Minor Build Revision
-----------------------403031942000
This is due to Version being set in the environment extensions class for compatibility, and is not the actual CLR version.
So $PSVersionTable is currently correct; but should be updated with the next release of .NET Core.
changed the title [-]incorrect $PSVersionTable output on Windows 10[/-][+]$PSVersionTable.CLRVersion property should be populated in PowerShell Core[/+]on Oct 3, 2016
Joey Aiello (@joeyaiello)Jason Shirk (@lzybkr) following Andy's link above to corefx, it appears Environment.Version is hardcoded to 4.0.30319.42000 for compat reasons. If the CLR version is useful (beyond this hardcoded string), it looks like we need to return the fileversion.
@PowerShell/powershell-committee discussed a bunch of options today:
removing the property: given the type of $PSVersionTable, $PSVersionTable.CLRVersion will still just emit $null. A cursory search reveals a non-zero amount of instances of people using .Contains which would still break
using the hardcoded value of [Environment]::Version
using the .VersionInfo.FileVersion of coreclr.dll (4.6.somethingorother)
Ultimately, the value is meaningless other than supporting back-compat. Given CoreCLR's decision to hardcode the string, we should talk to Immo Landwerth (@terrajobst) about .NET's thinking on this problem so that we don't do anything dumb.
@PowerShell/powershell-committee discussed this with dotnet team and agree that we should not be exposing ClrVersion property as guidance from dotnet is that users should not be taking dependency on this value as it's not providing intended value
changed the title [-]$PSVersionTable.CLRVersion property should be populated in PowerShell Core[/-][+]$PSVersionTable.CLRVersion property should be removed in PowerShell Core[/+]on Jun 15, 2017
Activity
vors commentedon Jul 17, 2016
In PSEdition Core is for CoreCLR, Desktop is for FullCLR, so there is no problems here.
alexandair commentedon Jul 17, 2016
Shouldn't CLRVersion property be populated?
joeyaiello commentedon Jul 20, 2016
Probably....
andyleejordan commentedon Sep 19, 2016
This is purposefully not set because it is supposed to be
[Environment]::Version, but that is not available in .NET Core (at least not in the current stable release; it is coming back per dotnet/corefx@fe5f4fb, which will be available in the next stable release). So while it is not available, it is set to null.Please note that the following will be confusing:
This is due to
Versionbeing set in the environment extensions class for compatibility, and is not the actual CLR version.So
$PSVersionTableis currently correct; but should be updated with the next release of .NET Core.Closing for now.
/cc Dongbo Wang (@daxian-dbw)
lzybkr commentedon Sep 20, 2016
If the api is coming back, this issue should be left open so we remember to fix the code.
If the api never comes back, we should consider either removing the entry or fill it in explicitly. An empty value is useless.
[-]incorrect $PSVersionTable output on Windows 10[/-][+]$PSVersionTable.CLRVersion property should be populated in PowerShell Core[/+]joeyaiello commentedon Apr 12, 2017
Jason Shirk (@lzybkr) do you happen to know which API we depended upon here? I want to validate if it's coming back with 2.0
lzybkr commentedon Apr 12, 2017
Looks like it's
Environment.Version:PowerShell/src/System.Management.Automation/engine/PSVersionInfo.cs
Line 70 in f0c0176
SteveL-MSFT commentedon Apr 12, 2017
Joey Aiello (@joeyaiello) Jason Shirk (@lzybkr) following Andy's link above to corefx, it appears Environment.Version is hardcoded to 4.0.30319.42000 for compat reasons. If the CLR version is useful (beyond this hardcoded string), it looks like we need to return the fileversion.
2 remaining items
joeyaiello commentedon Apr 19, 2017
@PowerShell/powershell-committee discussed a bunch of options today:
$PSVersionTable,$PSVersionTable.CLRVersionwill still just emit$null. A cursory search reveals a non-zero amount of instances of people using.Containswhich would still break[Environment]::Version.VersionInfo.FileVersionofcoreclr.dll(4.6.somethingorother)Ultimately, the value is meaningless other than supporting back-compat. Given CoreCLR's decision to hardcode the string, we should talk to Immo Landwerth (@terrajobst) about .NET's thinking on this problem so that we don't do anything dumb.
joeyaiello commentedon May 23, 2017
Assigning to myself to ping Immo Landwerth (@terrajobst) about this.
SteveL-MSFT commentedon Jun 14, 2017
@PowerShell/powershell-committee discussed this with dotnet team and agree that we should not be exposing ClrVersion property as guidance from dotnet is that users should not be taking dependency on this value as it's not providing intended value
[-]$PSVersionTable.CLRVersion property should be populated in PowerShell Core[/-][+]$PSVersionTable.CLRVersion property should be removed in PowerShell Core[/+]- Fix $PSVersionTable.CLRVersion since it's deprecated in PS Core -> P…