How to find out the highest, installed Powershell version FROM CommandPrompt?
Posted: 12 Apr 2022 23:14
As you know there is a system break in installation release procedure between PowerShell v5.1 and later Powershell versions (e.g. current v7.2.2).
Until v5.1 users could find out on CommandPrompt the maximum locally installed Powershell version by entering:
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "&{Get-Host | Select-Object Version}"
or
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "$psversiontable"
This does not work for newer Powershell versions any more.
If newer Powershell versions are installed: How can I find out their version label from Command Prompt (and DOS batch script) (without fiddling around in Registry and/or installation directory)?
Until v5.1 users could find out on CommandPrompt the maximum locally installed Powershell version by entering:
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "&{Get-Host | Select-Object Version}"
or
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "$psversiontable"
This does not work for newer Powershell versions any more.
If newer Powershell versions are installed: How can I find out their version label from Command Prompt (and DOS batch script) (without fiddling around in Registry and/or installation directory)?