How to find out PowerShell version quickly

Every Developer/DevOps was looking for this command at least once a year (including myself). The 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 transferable onto another environment) and reference some function that is not in (default) installed version.

Anyway…take this post as a reminder reference guide.

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

1. $PSVersionTable.PSVersion

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

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.

Thanks for staying, subscribe to my blog, and leave me a comment below.


Leave a Reply

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

You are commenting using your 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