Forum Discussion
Fix a broken $Profie location
- Apr 29, 2024
Ah in my case I have C:\Users\daniel\OneDrive and also through syncing with the other laptop the C:\Users\danie\OneDrive ( I originally caused issue with my bad spelling lol.)
So do I correct all the ones with the incorrect spelling given I have corrected the issue with the profile name.
Thanks for the reply.
I opened my windows terminal and entered both
# attempt 1
New-Item $profile
# attempt 2
New-Item $profile -Value C:\Users\daniel\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 -force -ItemType FileUnfortunately, neither work.
- Daniel WesterdaleApr 28, 2024Brass Contributor
Hi the original issue was caused due my attempting at fixing an invalid profile name on my other laptop with OneDrive Documents in place . Essentially, I want the profile just to reference my local path.
I made another attempt at fixing the profile:
$PROFILE = "$env:USERPROFILE\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"This re-enables my Oh My Posh settings but doesn't seem to persist the $Profile path
- Apr 29, 2024I was just wondering since you deleted the My Documents in your OneDrive... Did you have a backup of My Desktop, My Pictures, and My Documents configured? If you right-click your My Documents folder in Windows Explorer and select properties... What folder does the Location tab specify?
- Daniel WesterdaleApr 29, 2024Brass Contributor
Good morning. No backup as yet which I will remedy shortly. I do appear to have lost the My Documents quick access although Downloads, Music, Pictures all seem ok.
You have got me thinking : open up the recycle bin as all my previous PowerShell modules are located at c:\daniel\OneDrive\Documents\WindowsPowerShell\Modules.
Could these be the next steps:
- Restore these and back up this directory
- Re-add Documents to OneDrive
- Copy files over from backed up directory
- Check / amend the $Profile