PowerShell 7 icon grayed out

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 1 year and 9 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.
boswell0877
Posts: 3
Last visit: Thu Jun 23, 2022 11:31 am

PowerShell 7 icon grayed out

Post by boswell0877 »

Product, version and build: PowerShell Studio 2022 (Ver. 5.8.207)
Operating system: Windows 10
PowerShell version(s): 7.2.4

i just downloaded PowerShell Studio 2022 to play around with it in a virtual machine.
i first installed PowerShell (Ver. 7.2.4) and then Studio.

when i go to the Tools ribbon the Windows PowerShell icon is active however the PowerShell 7 icon is grayed out. is this because i am under a trial? if not any ideas why it is grayed out? the PowerShell 7 install is in the path since i checked that box when doing the install.

thanks!
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PowerShell 7 icon grayed out

Post by Alexander Riedel »

The trial version does not disable the use of PowerShell 7. It is expected to be in its default path under C:\Program Files\PowerShell\7
Do you have this installed in another location?
Alexander Riedel
SAPIEN Technologies, Inc.
boswell0877
Posts: 3
Last visit: Thu Jun 23, 2022 11:31 am

Re: PowerShell 7 icon grayed out

Post by boswell0877 »

yes, it is installed on my D drive (i use C for Windows, D for programs, E for user files, etc.).

when i get a chance i'll add a junction link to point C:\Program Files\PowerShell\7 to where it is on my D drive.

thanks!
boswell0877
Posts: 3
Last visit: Thu Jun 23, 2022 11:31 am

Re: PowerShell 7 icon grayed out

Post by boswell0877 »

adding a junction link (i.e. mklink /d "c:\Program Files"\PowerShell "d:\Program Files\PowerShell") allowed PowerStudio to ungray the icon.

any reason Sapien uses a hard-coded path instead of where PowerShell was installed?

there are two keys ("InstallDir" and "InstallLocation") under 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\31ab5147-9a97-4452-8443-d9709f0516e1' that points to where PowerShell is installed. not sure if '31ab5147-9a97-4452-8443-d9709f0516e1' is present for every install but it was there for both my Windows 7 and Windows 10 systems.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PowerShell 7 icon grayed out

Post by Alexander Riedel »

Historically Microsoft has been notoriously unreliable updating registry keys with correct values when updating or has been changing registry keys, locations etc. on a whim without documenting the change. So we just stopped using these values at some point.
Additionally most companies setting up divided system and applications partitions move the entire "Program Files" folder to another place, at which point that is not an issue.
I will forward this to the SPS team to see if they can enhance the "look for PowerShell 7" code in the future.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PowerShell 7 icon grayed out

Post by Alexander Riedel »

I do have to point out that the 'official' Program Files folder is a protected folder by default, meaning that elevated admin privileges are required to modify anything.
I hope your D:\Program Files folder has been added to the protected folders list in order to prevent a security risk.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 9 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.