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.
User avatar
HONDAAL
Posts: 13
Last visit: Mon Oct 04, 2021 6:36 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: 899
Last visit: Wed Oct 27, 2021 11:26 am
Answers: 20
Been upvoted: 17 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 Ryn
SAPIEN Technologies, Inc.

User avatar
brittneyr
Site Admin
Posts: 899
Last visit: Wed Oct 27, 2021 11:26 am
Answers: 20
Been upvoted: 17 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 Ryn
SAPIEN Technologies, Inc.