Page 1 of 1

Get-host version

Posted: Mon Nov 11, 2019 7:09 am
by lvl1bsm
In a powershell window I type get-host | select version and get 5.1.17763.592 If i use the same command in a script created by powershell studio I get a different version (3.0). Why is this and how can i write a script with powershell studio that pulls the local machines powershell version?

Powershell Stuidio 2019
5.6.167 64bit
Oerating system:
Windows 10 64bit

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Re: Get-host version

Posted: Mon Nov 11, 2019 11:40 am
by Alexander Riedel
The host version is not the same as the Powershell version. SAPIEN Powershell hosts have their own version numbering, so can other hosts.
The proper way to query for the actual PowerShell version is to use $psversiontable.