I’m encountering difficulties when attempting to create the $PROFILE
file to configure oh-my-posh in PowerShell. I’m using the latest version of PowerShell downloaded from the Microsoft Store.
The commands I’ve tried are as follows:
notepad $PROFILE
This returns an error since the file doesn’t exist. Then, I proceed to create the file using the command:
New-Item -ItemType File -Path $PROFILE -Force
However, this command throws an error stating: “New-Item: Could not find a part of the path ‘C:UsersMeDocumentsPowerShellMicrosoft.PowerShell_profile.ps1’.”
While there isn’t a PowerShell folder in the /Documents directory by default (even if I create one manually through File Explorer), I’m unable to resolve this issue. None of the tutorials I’ve watched on configuring oh-my-posh encounter this error, and I haven’t found a solution anywhere. Any assistance would be greatly appreciated. Thank you.
Mati Rojas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.