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
Get-host version
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.
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.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Get-host version
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.
The proper way to query for the actual PowerShell version is to use $psversiontable.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.