I cannot find the user's PowerShell local profile file on Linux. Where is it located at on non-Windows OSs?
Asked
Active
Viewed 5,550 times
2 Answers
4
Following the XDG Base Directory specification the user's profile file is located at:
~/.config/powershell/profile.ps1
dargmuesli
- 541
- 1
- 5
- 9
-
it does not exists by default? – Hafiz Feb 03 '20 at 16:32
4
You can always get the profile location on any OS by executing $PROFILE at the command prompt. This will output the location of the profile file.
For example, on my Mac
> $PROFILE
/Users/robb/.config/powershell/Microsoft.PowerShell_profile.ps1
Robb Vandaveer
- 141
- 3
-
On a fresh install of pwsh on OS X Ventura, this file doesn't exist; the `.config` dir didn't even exist. You have to create it. – Max Cascone Nov 03 '22 at 04:56
-
You may need to create it depending on your OS, how you installed PowerShell and what activities you did in PowerShell before looking for your profile file. This is still the location nonetheless. – Robb Vandaveer Nov 12 '22 at 12:17