I am looking at my $profile variable and I see that it is pointing to C:\users\username\Documents\windowsPowershell\Microsoft.Powershell_profile.ps1
However, when I attempt to browse to this directory I cannot find the folder/directory named WindowsPowerShell that is supposed to be in the documents folder. Any ideas?
I was hoping I could set a permanent path that is linked to my profile or at least loaded with it when Powershell is loaded. Am I on the right track here?
thanks!
-Dustin
The $PROFILE variable The $PROFILE automatic variable stores the paths to the PowerShell profiles that are available in the current session. To view a profile path, display the value of the $PROFILE variable. You can also use the $PROFILE variable in a command to represent a path.
PowerShell.exe -NoProfile. When you launch PowerShell with NoProfile parameter, it ensures to run script in default PowerShell environment and run without any Windows PowerShell profile.
What you see for the path is right. It is the path for your user profile (for the console host) and it is normal to not see the folder and the file. You can create it and start using your profile - new-item -type file -path $profile -force
See here for more: http://technet.microsoft.com/en-us/library/dd315342.aspx
This is the case when you mistakenly delete your profile file.
You can manually create the "Microsoft.Powershell_profile.ps1" at the location of your profile.
$profile
in cmd/powershell and you will get the location of your profile.In my case, it was
"D:\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
So, I manually create the "WindowsPowerShell
" folder inside Documents
and the "Microsoft.PowerShell_profile.ps1
" file in WindowsPowerShell
.
Then pasted the content in the profile.
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme Paradox
Hope this resolves your issue. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With