$profile is just a variable pointing to the default location of the file. The file itself might or might not exist, in the latter scenario you need to create it (notepad). Answer from vasilmichev on techcommunity.microsoft.com
🌐
SS64
ss64.com › ps › syntax-profile.html
Set the PowerShell startup $Profile user environment
By default, the profile file does not exist, even though PowerShell has a filename for it, the file can be created using New-Item or notepad.
🌐
Gitbook
poshcode.gitbook.io › powershell-faq › src › getting-started › environment-variables
How do I set the PATH in PowerShell? | PowerShell FAQ
April 18, 2021 - The PATH, like all environment variables, is accessible in PowerShell via the Env drive, and you can set it using variable syntax, like: $Env:PATH += ";$pwd" to add the present working directory to it.
🌐
GitHub
gist.github.com › fced1b2b5b522642871421349d701e0d
PowerShell Profiles · GitHub
Current user, Current Host - $HOME\Documents\PowerShell\Microsoft.VSCode_profile.ps1 · The profile paths include the following variables:
🌐
LazyAdmin
lazyadmin.nl › home › how to create a powershell profile – step-by-step
How to Create a PowerShell Profile - Step-by-Step — LazyAdmin
May 17, 2024 - # Load scripts from the following locations $env:Path += ";D:\SysAdmin\scripts\PowerShellBasics" $env:Path += ";D:\SysAdmin\scripts\Connectors" $env:Path += ";D:\SysAdmin\scripts\Office365" Another useful tip is to set default variables in your profile. For example, I often need to connect to Office 365.
🌐
Microsoft
devblogs.microsoft.com › dev blogs › scripting blog [archived] › powertip: find all powershell profile locations
PowerTip: Find All PowerShell Profile Locations - Scripting Blog [archived]
July 19, 2014 - Summary: Use the hidden properties of $profile to find Windows PowerShell profile locations. How can I find the path to Windows PowerShell profile locations on my computer? Use the –Force parameter from Format-List to display the hidden properties and values: $PROFILE | Format-List -Force
🌐
GitHub
gist.github.com › soulfx › 50cf9ff07a68abf1c4712710bc5e8436
basic MS Powershell profile · GitHub
basic MS Powershell profile · Raw · Microsoft.PowerShell_profile.ps1 · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Find elsewhere
🌐
Idea 11
idea11.com.au › home › how to create a powershell profile
How to Create a PowerShell Profile (Step-by-Step Guide) | Idea 11
December 4, 2025 - The $profile variable stores the path to the profile file itself: PS C:> $profile C:UsersPaulDocumentsWindowsPowerShellMicrosoft.PowerShell_profile.ps1
🌐
Computer Performance
computerperformance.co.uk › home › powershell
PowerShell scripting, how to configure settings for profile.ps1
July 21, 2018 - More modern Microsoft operating ... of this page is to configure the equivalent PowerShell file: profile.ps1. ... Profile.ps1 location The key to getting started is to make sure that profile.ps1 is in the correct path....
🌐
Helge Klein
helgeklein.com › blog › changing-location-powershell-profile-script
Changing the Location of PowerShell Profile Scripts
March 14, 2026 - Per-user PowerShell profile scripts are stored in the Windows user profile. The path and name depend on the PowerShell version as well as the PowerShell host (e.g., Windows Terminal, VS Code).
🌐
Arcelopera
arcelopera.github.io › PowershellWeb › config_profile
Config Profile - Powershell Refresher
Open PowerShell and run the following command to create a new profile file if it doesn't exist: if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
🌐
Sconstantinou
sconstantinou.com › stephanos constantinou blog › powershell tutorials › powershell profiles
PowerShell Profiles - Stephanos Constantinou Blog
January 20, 2025 - The $Profile variable stores the path to the “Current User, Current Host” profile. The other profiles are saved in note properties of the $Profile variable. You can specify a profile by using the properties of the variable.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › microsoft.powershell.management › set-location
Set-Location (Microsoft.PowerShell.Management) - PowerShell | Microsoft Learn
The Set-Location cmdlet sets the working location to a specified location. That location could be a directory, a subdirectory, a registry location, or any provider path. PowerShell 6.2 added support for - and + as a values for the Path parameter. PowerShell maintains a history of the last 20 ...
🌐
GitHub
github.com › zloeber › PowerShellProfile
GitHub - zloeber/PowerShellProfile: My personal PowerShell profile · GitHub
iex (New-Object Net.WebClient).DownloadString("https://raw.githubusercontent.com/zloeber/PowerShellProfile/master/Install.ps1") Once you have installed the basic components you can secure your profile a bit with a code signing certificate. An extra script or two I put together will do just that for ya if you like: . (Split-Path $Profile)\Scripts\New-CodeSigningCertificate.ps1
Author   zloeber
🌐
CSDN
cnblogs.com › backpacker › p › 4711823.html
Powershell Profiles配置文件的存放位置介绍 - allenbackpacker - 博客园
4、%UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 作用于当前用户的Microsoft.PowerShell这个shell。 · 创建这个文件 · New-Item -Path "C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.Power...
🌐
Itenium
itenium.be › home › blog › powershell profiles
PowerShell profiles - Itenium
September 3, 2018 - # executes automatically $homeDocumentsWindowsPowerShellprofile.ps1 # executes with console host only $homeDocumentsWindowsPowerShellMicrosoft.PowerShell_profile.ps1 # executes with ISE only $homeDocumentsWindowsPowerShellMicrosoft.PowerShellISE_profile.ps1 # Visual Studio Package Manager Console $homeDocumentsWindowsPowerShellNuGet_profile.ps1 · When . $profile doesn’t quite cut it. function Reload-Profile { @( $Profile.AllUsersAllHosts, $Profile.AllUsersCurrentHost, $Profile.CurrentUserAllHosts, $Profile.CurrentUserCurrentHost ) | % { if (Test-Path $_) { Write-Verbose "Reloading $_" .
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › scripting › learn › shell › creating-profiles
Customizing your shell environment - PowerShell | Microsoft Learn
November 21, 2025 - PS> $PROFILE | Select-Object * AllUsersAllHosts : C:\Program Files\PowerShell\7\profile.ps1 AllUsersCurrentHost : C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1 CurrentUserAllHosts : C:\Users\username\Documents\PowerShell\profile.ps1 ...
Top answer
1 of 2
3

The answer from harrymc is mostly right, except Microsoft has changed things and moves things around and doesn't update their documentation.

Try this to understand your Powershell "profile" scripts:

PS C:\Users\you> $PROFILE | select-object *

The output will be something like:

AllUsersAllHosts       : C:\Program Files\PowerShell\7\profile.ps1
AllUsersCurrentHost    : C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts    : C:\Users\you\OneDrive\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\you\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Length                 : 77

This tells you where the profiles are, for you.

2 of 2
2

The blog post you have found is from 2012 and refers to an older version of Windows. While most of it is still correct, the profile folders are not up to date.

The article you found is more recent from 2023, so is to be taken seriously. The "Current user, Current Host" profile location is said to be in $HOME\Documents\PowerShell, which refers to C:\Users\USER-NAME\Documents\PowerShell.

If you install OneDrive, it will by default backup the Documents folder, by relocating it into the OneDrive sync folder and leaving only a pointer to it in C:\Users\USER-NAME.

This means that, if you have accepted the default setup of OneDrive, your PowerShell profiles are by default synced to OneDrive, but your reference is to a local folder. The profiles will be backed up to OneDrive, but the reference should stay to the local disk, not to the OneDrive folder in the cloud, to avoid problems when there is no internet connection.

🌐
GitHub
gist.github.com › jonlabelle › f2a4fdd989dbfe59e444e0beaf07bcc9
PowerShell Profile Paths · GitHub
PowerShell Profile Paths. GitHub Gist: instantly share code, notes, and snippets.