How to find out PowerShell version quickly

Every Developer/DevOps was looking for this command at least ones a year (including myself). Truth is that we all like PowerShell and sometimes tend to forget put a running engine pre-conditional check inside a batch script (as whatever script you’re producing, always make sure that it’s transfarable onto another environment) and referencing some function which is not in (default) installed version.

Anyway…take this post as a reminder reference quide.

3 ways of how to quickly find out what version of PowerShell having installed

1. $PSVersionTable.PSVersion

This is my prefered way over the others. Why? Because it works on local as well as on remote station.

2. (Get-Host).Version

3. $host.Version

Summing this up

That’s it. Hope you like this short reminder and let me know your preferred way of doing this. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s