Powershell: $PROFILE is not updated to default location on Windows

Created on 3 Feb 2020  路  3Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

Re: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6

Install PowerShell Core according to guidelines: dotnet tool install --global PowerShell

Expected behavior

$PROFILE is updated to C:\Users\me\Documents\PowerShell\Profile.ps1

Actual behavior

C:\Users\me\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 (location and file does not exist and unable to edit $PROFILE)

Environment data

PS ~ > $PSVersionTable

Name Value
---- -----
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Microsoft Windows 10.0.19035
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

PS ~ >

Issue-Question Resolution-Answered

Most helpful comment

You should manually create the path and file.

All 3 comments

C:\Users\me\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 _is_ the correct path:

  • The PowerShell-only name is in the _parent_ folder name (PowerShell vs. WindowsPowerShell).

  • Microsoft.PowerShell still applies (note: _Microsoft_, not _Windows_) - it is based on the regular console host's $ShellId value, which hasn't changed.

_Update_: Additionally, as implied by @iSazonov's comment below, PowerShell neither creates the $PROFILE itself nor does it ensure its directory's existence.

You should manually create the path and file.

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Was this page helpful?
0 / 5 - 0 ratings