Get-host version

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
lvl1bsm
Posts: 1
Last visit: Mon Dec 16, 2019 9:45 am

Get-host version

Post 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
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Get-host version

Post 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.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 4 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.