I would like to configure PowerShell to run the default profile.ps1 script from a local folder, instead of my configured Documents folder.
I initially configured my Document Folder to be saved inside my OnDrive to prevent losing my Documents in case of a crash. However, due to that change, when I launch Powershell, it is trying to execute the profile.ps1 script from the preconfigured OneDrive/Documents.profile.ps1 and that is not allowed for security reasons.
I would like to configure Powershell to run the profile.ps1 from a local folder on my C: instead. How do I proceed?
I Opened PowerShell and ran the $PROFILE command. It displayed the OneDrive Documents folder location.
C:\Users\Joey\OneDrive\Documents\WindowsPowerShell\profile.ps1
I think I can point the $PROFILE variable to the local C: folder, but can't seem to find its location to update it. I Tried adding a PROFILE variable to the System Environment Variable, but that did not work.
Please advise.