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.
Daniel Westerdale Does this work? This recreates the profile in it's default location.
New-Item $profile -Force
- Daniel WesterdaleApr 28, 2024Brass Contributor
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.
- Apr 28, 2024Is the file created afterward? And if you re-enable the OneDrive backup, does it 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