WindowsmacOSLinux

Where Is the PowerShell Profile?

Where PowerShell profiles live on Windows, macOS, and Linux, per user and per host.

Last updated

PowerShell loads up to four profiles per session: user versus machine scope crossed with current host versus all hosts. $PROFILE points at the usual one (CurrentUserCurrentHost); $PROFILE.AllUsersCurrentHost shows the machine twin.

Windows paths center on Documents\PowerShell (or WindowsPowerShell for 5.1), while macOS and Linux use ~/.config/powershell. The ISE, VS Code, and console hosts each get their own filename variant. Create only the scope you need.

Where PowerShell stores this, by platform

Windows
%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

CurrentUserCurrentHost for PowerShell 7 (Microsoft.PowerShell_profile.ps1). 5.1 uses Documents\WindowsPowerShell instead. Inspect all scopes via $PROFILE | Select *.

macOS
~/.config/powershell/Microsoft.PowerShell_profile.ps1

Same four-scope model under the XDG config home. VS Code host variant is Microsoft.VSCode_profile.ps1 beside the console one.

Linux
~/.config/powershell/Microsoft.PowerShell_profile.ps1

Same layout as macOS. Case matters on Linux filesystems; keep the Microsoft.* casing exactly.

Frequently asked questions

How do I find and create my profile?

Run $PROFILE | Select-Object * to print all four paths (user/host combos), then New-Item -ItemType File -Path $PROFILE -Force to create the current one. Edit it like any script; syntax errors only affect interactive shells.

Which profile scope should I edit?

AllUsers profiles apply machine-wide (in the install dir), CurrentUser ones per account, and Host-specific variants load only in their console (console versus VS Code versus ISE). Prefer CurrentUserCurrentHost for personal tweaks.

Notice an outdated path? Let us know.