Power-shell command to determine the version of installed power-shell engine

powershellAt times you would come across facts like blah-blah command is supported in so-and-so version of power-shell. When such facts are encountered, the first thing that comes in one’s mind is “What version of power-shell am I using?”.

The answer to this question can be obtained by running following small command in your available power-shell console:

$psversiontable.psversion

Note: If you do not get a result for the above command, then don’t panic, but safely consider that you are using the v1.0 of power-shell engine, as this variable is not present in v1.0.

Caution: Some of you might be using the command “$host.version” to achieve the required result. But mind you, it is not the correct method. The reason is that command “$host.version” gives the product version of the host application using the power-shell engine. When you use the bare simple power-shell interface to execute your commands/scripts, you would get same result through both commands as in this case the host version and engine version go hand-in-hand and so are same.