Forum Discussion

Daniel Westerdale's avatar
Daniel Westerdale
Copper Contributor
Apr 25, 2024

Fix a broken $Profie location

 

A couple of days ago I remove Documents from OneDrive which seems to have broken the "Oh my POSH" settings in my various terminals. 

 

 

PowerShell 7.4.2
PS C:\Dev> $home
C:\Users\daniel
PS C:\Dev> $Profile
\PowerShell\Microsoft.PowerShell_profile.ps1
PS C:\Dev>

 

 

 

It looks like $Profle has lost the preceding C:\Users\daniel\Documents\PowerShell,  so is there a way to re-add it, without needing to reinstall PowerShell Core and Windows PowerShell? 

 

 

 

  • Harm_Veenstra 

     

     

    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's avatar
      Daniel Westerdale
      Copper Contributor

      Harm_Veenstra 

       

      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 File

      Unfortunately, neither work.

       

      • Harm_Veenstra's avatar
        Harm_Veenstra
        MVP
        Is the file created afterward? And if you re-enable the OneDrive backup, does it work?