Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
16 views
in PowerShell by 4 6 10

What's the simple way that I cau use to detect the current PowerShell version I use on the current machine? I need before running the PowerShell script check if it's compatiable with the current PowerShell version or not? How can I get Get current PowerShell Version?


1 Answer

0 like 0 dislike
by 56 122 250

How to get the current PowerShell Version?

To get the current PowerShell Version, you should run one of the below cmdlets:

  1. Host
  2. $PSVersionTable

1) Using "Host" to detect the current PowerShell Version

  1. Open Windows PowerShell.
  2. Type "Host"

Output
what's the current PowerShell Version

2) Using "$PSVersionTable" to detect the current PowerShell Version

  1. Open Windows PowerShell.
  2. Type "$PSVersionTable.PSVersion"

Output
Which PowerShell Version I currently use

See Also The term 'Install-Module' is not recognized

If you don’t ask, the answer is always NO!
...