Use $PsVersionTable.PSVersion. If this variable does not exist, the engine version is 1.0.

Advertisements