How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?
The below cmdlet will return the PowerShell version.
$PSVersionTable.PSVersion.Major