Steps to attempt

  1. Run in admin shell
    • notepad $Profile
  2. If fails, in admin shell
    • New-Item -ItemType File -Path $PROFILE -Force
    • notepad $Profile
  3. If fails (unlikely) still in admin shell
    • Set-ExecutionPolicy RemoteSigned
    • Go to step 1
Answer from ΩmegaMan on Stack Overflow
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › module › microsoft.powershell.core › about › about_profiles
about_Profiles - PowerShell | Microsoft Learn
September 29, 2025 - In this command, the if statement prevents you from overwriting an existing profile. Replace the value of the $PROFILE variable with the path to the profile file that you want to create. ... To create "All Users" profiles in Windows Vista and later versions of Windows, start PowerShell with the Run as administrator option.
🌐
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 ...
Discussions

Leveling up PowerShell Profile
Brief fun note on aliases : all Get-* cmdlets are automatically aliased by whatever the * is. For example: date, childitem, netipinterface all work out-of-the-box ( though it's not a good idea to use them that way ). More on reddit.com
🌐 r/PowerShell
82
139
July 26, 2024
What can I use the $PSHome 'profile.ps1' for in regular PowerShell? (Not ISE)
There's a default variable in the shell called $profile that contains the path to the profile. The easiest way to create a new Profile would be to use: notepad $profile Note that there are multiple different profiles that behave differently: $profile.CurrentUserCurrentHost $profile.CurrentUserAllHosts $profile.AllUsersAllHosts $profile.AllUsersCurrentHost The default profile is CurrentUserCurrentHost. More on reddit.com
🌐 r/PowerShell
15
2
July 25, 2024
🌐
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 - I don’t want a single point of failure, by using just one script file for the functions, how to prefend that? Howto manage certificates and signing in this specific case? You can use PowerShell modules to load different functions inside your PowerShell script (profile).
🌐
CircleCI
support.circleci.com › hc › en-us › articles › 19909025406363-How-to-create-and-use-a-custom-PowerShell-profile
How to create and use a custom PowerShell profile – CircleCI Support Center
February 2, 2026 - version: 2.1 orbs: windows: circleci/windows@5.0.0 commands: create_profile: steps: - run: name: Set PowerShell profile command: | Copy-Item .\MyPowershellProfile.ps1 $PROFILE.AllUsersCurrentHost jobs: build: machine: image: windows-server-2022-gui:current resource_class: windows.medium shell: powershell.exe steps: - checkout - create_profile - run: name: Test step with profile shell: powershell.exe command: | Write-Host "TEST_VAR is $env:TEST_VAR" - run: name: Test step with no profile shell: powershell.exe -NoProfile command: | Write-Host "TEST_VAR is $env:TEST_VAR" workflows: my-workflow: jobs: - build
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.

🌐
Xah Lee
xahlee.info › powershell › powershell_profile.html
PowerShell: Profile (init file)
June 10, 2022 - $profile | Get-Member -Type NoteProperty | Format-List # TypeName : System.String # Name : AllUsersAllHosts # MemberType : NoteProperty # Definition : string AllUsersAllHosts=C:\Program Files\PowerShell\7\profile.ps1 # TypeName : System.String # Name : AllUsersCurrentHost # MemberType : NoteProperty # Definition : string AllUsersCurrentHost=C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1 # TypeName : System.String # Name : CurrentUserAllHosts # MemberType : NoteProperty # Definition : string CurrentUserAllHosts=C:\Users\xah\Documents\PowerShell\profile.ps1 # TypeName : System.String # Name : CurrentUserCurrentHost # MemberType : NoteProperty # Definition : string CurrentUserCurrentHost=C:\Users\xah\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Find elsewhere
🌐
Red Gate Software
red-gate.com › home › persistent powershell: the powershell profile
Persistent PowerShell: The PowerShell Profile | Simple Talk
October 3, 2017 - PowerShell itself can easily tell you, but it can also just open one for editing without you having to explicitly bother with the path. To see the path, display the value of the $Profile variable. It reveals a single file path, which is the path to the CurrentUserCurrentHost profile.
🌐
TechTarget
techtarget.com › searchwindowsserver › tutorial › How-to-find-and-customize-your-PowerShell-profile
How to find and customize your PowerShell profile | TechTarget
Therefore, if we want to find the path for the AllUsersAllHosts profile, we can do so with: ... On our system, the result is C:\Program Files\PowerShell\7\profile.ps1 for the path.
🌐
Reddit
reddit.com › r/powershell › leveling up powershell profile
r/PowerShell on Reddit: Leveling up PowerShell Profile
July 26, 2024 -

Hello PowerShell Enthusiasts 👋,

Many people treat their shell as just a script runner, but as someone who loves PowerShell and runs it on all their machines (Windows, Mac, and Linux), I wanted to share all the amazing things you can do with it beyond just running scripts.

https://blog.belibug.com/post/ps-profile-01/

My latest blog post has several not-so-common ways to elevate your PowerShell experience for beginners. It covers:

  • Personalizing your prompt

  • Mastering aliases and modules

  • Leveraging tab completion

  • Enhancing your shell with modules

  • ...and much more!

This list is just the tip of the iceberg! If you have any other PowerShell tricks or tips that I haven't covered, or there is better way to do it, let me know – I'm always eager to learn and will update content accordingly 😊 Happy weekend!

PS: Don't let the length scare you off! Use the handy TOC in the blog to jump around to the juicy bits that interest you most. Happy reading! 🤓

🌐
Reddit
reddit.com › r/powershell › what can i use the $pshome 'profile.ps1' for in regular powershell? (not ise)
r/PowerShell on Reddit: What can I use the $PSHome 'profile.ps1' for in regular PowerShell? (Not ISE)
July 25, 2024 -

Hi All,

I'm familiar with using a PowerShell ISE 'profile file' in which to store useful settings and content you'd like available across PowerShell ISE sessions on a given host.

In this instance, that file has the standard name 'Microsoft.PowerShellISE_profile.ps1'.

Almost my entire PowerShell experience to date has been limited to using PowerShell ISE. If I would like to make similar chunks of code available to myself using regular Non-ISE PowerShell, I would have thought I could create a file with name 'profile.ps1' and put it in the location defined by $PSHOME.

I tried that, but I can't see a sign that PowerShell is 'recognising' the file I placed there.

I'm assuming I'm missing something key in terms of differences between PowerShell.exe and PowerShell ISE. Is there anything equivalent to non-ISE PowerShell in terms of 'profile files' or similar?

🌐
Chester
chester.codes › powershell-profile
Powershell profile | chester.codes
January 12, 2016 - The command powershell -file .\AddFilesToProfile.ps1 should be enough to install it, if it doesn’t work then try running it again. The AddFilesToProfile.ps1 script does the following things · Finds out where it is running and figures out which of the two environment files to use by looking at the computer name from the environment. Creates a new profile file if it doesn’t already exist and timestamp archives it, if it already exists.
🌐
GitHub
github.com › ChrisTitusTech › powershell-profile › blob › main › Microsoft.PowerShell_profile.ps1
powershell-profile/Microsoft.PowerShell_profile.ps1 at main · ChrisTitusTech/powershell-profile
Write-Host "Profile has been updated. Please restart your shell to reflect changes" -ForegroundColor Magenta ... # Check if not in debug mode AND (updateInterval is -1 OR file doesn't exist OR time difference is greater than the update interval) ... Start-Process powershell.exe -ArgumentList "-NoProfile -Command winget upgrade Microsoft.PowerShell --accept-source-agreements --accept-package-agreements" -Wait -NoNewWindow
Author   ChrisTitusTech
🌐
GitHub
github.com › ChrisTitusTech › powershell-profile
GitHub - ChrisTitusTech/powershell-profile: Pretty PowerShell that looks good and functions almost as good as Linux terminal · GitHub
Do not make any changes to the Microsoft.PowerShell_profile.ps1 file, since it's hashed and automatically overwritten by any commits to this repository.
Starred by 962 users
Forked by 462 users
Languages   PowerShell
🌐
IT-Connect -
it-connect.tech › home › customizing your powershell profile
Creating and customizing a PowerShell profile
March 13, 2025 - In each case, the profile file is represented by a file in ".ps1" format. The profile is loaded as soon as a new PowerShell session is started. In other words, when you open a PowerShell console, your profile is loaded.
🌐
SQLTreeo
sqltreeo.com › docs › powershell-profiles
PowerShell Profiles
July 24, 2022 - NOTE: Profiles are simply PowerShell scripts (.ps1 files) that run when PowerShell starts up, so the execution policy will be applied.