Changing the PowerShell module export path

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 2 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
HONDAAL
Posts: 15
Last visit: Wed Dec 22, 2021 10:02 am
Has voted: 1 time

Changing the PowerShell module export path

Post by HONDAAL »

Product, version and build: PowerShell Studio 2021 v5.8.191
Operating system: Windows 10 1909
PowerShell version(s): 5.1 and 7.1

Due to increased security efforts, I now have three different accounts under which I need to run PowerShell Studio (PSS). By default, PSS exports PowerShell modules to the user's path. I would like to change PSS to use one of the 'system' paths, such as "C:\Program Files\PowerShell\Modules" (for V5) and "c:\program files\powershell\7\Modules" (for V7). Is it possible to configure PSS to do this?
by brittneyr » Thu Sep 23, 2021 8:04 am
To write to Program Files, PowerShell Studio will need to be running as an administrator. I could talk to the development team about detecting if it is running as an administrator, to write to Program Files folder rather than user's path, but as of the latest release, it does not do this.
Go to full post
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Changing the PowerShell module export path

Post by brittneyr »

To write to Program Files, PowerShell Studio will need to be running as an administrator. I could talk to the development team about detecting if it is running as an administrator, to write to Program Files folder rather than user's path, but as of the latest release, it does not do this.
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Changing the PowerShell module export path

Post by brittneyr »

PowerShell Studio service build 5.8.195 was released. A new option was added to module projects to export to a local machine path if PowerShell Studio is running as administration. This option is set to false by default.
Brittney
SAPIEN Technologies, Inc.
This topic is 2 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.