Sunday, August 22, 2010

How to figure out your powershell version

Want to know what version of powershell your script is running under? Simply run this in your powershell console or drop it in your script:

Get-Host | Select-Object version


The Get-Host commandlet returns an object representing the current host program. Just pipe that to the Select-Object commandlet, specify your attribute and you're done!

PS C:\Users\joe> get-host | select-object version


Version
-------
2.0

No comments:

Post a Comment