Get-PSVersion


posted by Aleksandar
05-31-2009

Downloads: 1,166
File size: 285 B
Views: 7,062

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.
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.