How to move the WindowsPowerShell folder?

Hello there.

Some times ago I installed some additional components for PowerShell and a folder popped up inside my personal Documents folder. Its path is:
c:\Users%username%\OneDrive\Documents\WindowsPowerShell
Is there a way I can move this to another location?

PS : please apps, leave my personal Documents folder alone.

Thanks
David

Technically I think you could move it, but many things that are ‘currentuser’ scoped will always go to that path such as Install-Module. If you changed it you would have a heck of a time getting things working IMO. You’re better off just leaving it.

This issue has been raised in the PS GitHub issues.

1 Like

So no way to do this at the present time?
There are too many apps creating folder in Documents. If I keep the folder WindowsPowerShell in my Documents folder, and if I make it hidden, the scripts won’t work.

Ignore it! :man_shrugging:t3:

My workaround is to install all PS modules with scope AllUsers - you need an elevated PS session to do that. It’s sub-optimal, but it installs them outside of my user profile.

This seems to work!! Thanks a lot Darwin!

1 Like