Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
2 like 0 dislike
1k views
in PowerShell by 12 13 20

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

3 like 0 dislike
by 159 200 385
selected by
 
Best answer

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!
...