r/PowerShell • • 13d ago

Question PowerShell 7.7 - All users profile script location

Starting with PowerShell 7.7 it is now a windows app and if you install it with Add-AppxPackage, then it will live in "C:\Program Files\WindowsApps\Microsoft.PowerShell_7.7.0.0_x64__8wekyb3d8bbwe"

On previous versions I had profile.ps1 live in "C:\Program Files\PowerShell\7"
However not only do I suspect the bin directory will change with each new version, it is now read-only for everything except system, you can't put any files in there without hacking it with system privileges.
Where do they expect us to put all user scripts now?

81 Upvotes

24 comments sorted by

View all comments

56

u/jborean93 13d ago • Bravo

Where do they expect us to put all user scripts now?

Unfortunately it's a known limitation, you can't edit anything in $PSHome as they are immutable for MSIX packages, and the work to enable a custom location never landed in 7.7 (see enterprise configuration https://github.com/PowerShell/PowerShell/issues/27565#issuecomment-6802573646).

You have a few options:

  • Use a per user profile rather than all users
  • Stick with 7.6.x, it still has an .msi and is an LTS
  • Upgrade to 7.7.x but use the .zip and extract to C:\Program Files\PowerShell\7 (or any location really)
  • Use a 3rd party .msi, or build your own, from the .zip assets

None are great but not too much you can do

17

u/stumper66 13d ago

This answers my question.

3

u/Incrediblecodeman 13d ago

I love it when Reddit provides

11

u/warren_stupidity 13d ago

Use a gpo that sticks a standard profile in the CurrentUserAllHossts or CurrentUserCurrentHost directory for each user.

But holy shit, they are getting even further away from being able to remove psh5.1 from systems. That bug list is magnificent. Let's just release this mess that breaks a whole lot of stuff, and all we have is concepts of a plan for fixing the mess we are making.

3

u/rswwalker 12d ago

Ugh! Why doesn’t MS realize admins don’t need no stinking msstore, just put the MSI in winget with the option to install per-user or per-machine and we’re all happy.

5

u/Thotaz 13d ago

Their definition of "Blocker" is certainly unique in the industry.