Powershell: change the value $ShellId to powershell

Created on 2 Feb 2020  路  2Comments  路  Source: PowerShell/PowerShell

change the value $ShellId to powershell rather than Microsoft.PowerShell

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.1
PSEdition                      Core
GitCommitId                    7.0.0-rc.1
OS                             Microsoft Windows 6.3.9600
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\> $ShellId
Microsoft.PowerShell
PS C:\>
Issue-Question Resolution-Answered

Most helpful comment

This would be breaking change, from what I can tell, because $ShellID is used to derive configuration paths / settings from, notably the (current-host) $PROFILE path(s). (The distinction between the editions is in the parent directory name).

Also, PS Core is still _Microsoft_ PowerShell, just not _Windows_ PowerShell anymore.

To distinguish between the editions you have $PSVersionTable.Edition and $IsCoreCLR.

All 2 comments

This would be breaking change, from what I can tell, because $ShellID is used to derive configuration paths / settings from, notably the (current-host) $PROFILE path(s). (The distinction between the editions is in the parent directory name).

Also, PS Core is still _Microsoft_ PowerShell, just not _Windows_ PowerShell anymore.

To distinguish between the editions you have $PSVersionTable.Edition and $IsCoreCLR.

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Was this page helpful?
0 / 5 - 0 ratings