Forum Discussion
Miike445
Feb 06, 2024Copper Contributor
Can you redirect the -UseWindowsPowerShell temp path in a session when running import-module?
Hi All,
I'm using PS7 and calling a bunch of modules.
To get Microsoft.Online.SharePoint.PowerShell to import correctly in PS7, I need to use the switch -useWindowsPowerShell. Without restrictions this is all fine.
Using Constrained Language Mode, WDAC blocks the module on import in PS7, it'll import in PS5 without any changes. Looking at the event viewer its due to the proxy being setup in the user's appdata temp folder.
Is there a process to modify the location of the proxy being created in the current session? It'd be great to redirect it to a whitelisted location for execution to avoid the issue. Whitelisting the temp folder for users isn't an option.
Thanks!
No RepliesBe the first to reply