You're not showing how you are validating that this is happening.
All you are showing is the prompt return.
Start your session, then $PSVersionTable, then type pwsh, then type $PSVersionTable again.
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {...
pwsh
PowerShell 6.2.4
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS D:\Scripts> $PSVersionTable
Name Value
---- -----
PSVersion 6.2.4
PSEdition Core
GitCommitId 6.2.4
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {...
PS D:\Scripts> exit
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {...
You could easily change your profile to show you on your prompt what version you are in, as you switch between them.
As per your comment.. .
there is no command like "pwsh" only pwsh-preview PSVersion 5.1.17763.771
Your statement is incorrect. that above screen output is the exact output from my system running the latest release of Powershell v7.
I am not new to this. I've been using PowerShell since before it was called PowerShell as an alpha user and insider.
Here are the properties from the shortcut that gets created on installation.
Shortcut title
'PowerShell 6 (x64)' ---
shortcut path "C:\\Program Files\\PowerShell\\6\\pwsh.exe" -WorkingDirectory ~
You are running an earlier preview and I am running current release. Hence the difference.
https://github.com/PowerShell/PowerShell/releases
PowerShell-6.2.4-win-x64.msi
PowerShell-6.2.4-win-x64.msix
PowerShell-6.2.4-win-x64.zip
PowerShell-6.2.4-win-x86.msi
PowerShell-6.2.4-win-x86.zip
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.