When is PowerShell not PowerShell? When its PowerShell v6.
This applies to beta 9 and later
Check a v6 instance
PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable Name Value ---- ----- PSVersion 6.0.0-beta.9 PSEdition Core GitCommitId v6.0.0-beta.9 OS Microsoft Windows 10.0.17035 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
Now try and run PowerShell
PS C:\Program Files\PowerShell\6.0.0-beta.9> powershell Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS> $PSVersionTable Name Value ---- ----- PSVersion 5.1.17035.1000 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17035.1000 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
You get your v5.1 instance! You HAVE to use pwsh
PS> exit PS C:\Program Files\PowerShell\6.0.0-beta.9> pwsh PowerShell v6.0.0-beta.9 Copyright (C) Microsoft Corporation. All rights reserved. PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable Name Value ---- ----- PSVersion 6.0.0-beta.9 PSEdition Core GitCommitId v6.0.0-beta.9 OS Microsoft Windows 10.0.17035 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
The command to start PowerShell v6 on Linux is also pwsh.
This is wrong on so many levels that its difficult to explain. I know its supposed to enable the separation on v6 and any older versions in a side by side install but having to remember this adds another level of unnecessary thought to using PowerShell. I’ve been a big fan of PowerShell for over 12 years but v6 and the changes that are being made are in many instances a step backwards for an illusionary gain.