Idera nSoftware Compellent

Get-PSVersion


posted by Aleksandar
05-31-2009

Downloads: 366
File size: 285 B
Views: 2,648

Embed
Get-PSVersion
  1. # If the $PSVersionTable variable doesn't exist, then you are running V1. 
  2. # If it does exist, then the version will be available as $PSVersionTable.PSVersion. 
  3.  
  4. function Get-PSVersion
  5.     if (test-path variable:psversiontable) {$psversiontable.psversion} else {[version]"1.0.0.0"
Filed under: , ,
How do you check which version of PowerShell you are using? If the $PSVersionTable variable doesn't exist, then you are running V1. If it does exist, then the version will be available as $PSVersionTable.PSVersion.
Copyright 2010 PowerShell.com. All rights reserved.