I am unable to create a profile in PowerShell 7.3.2.
When I run notepad $PROFILE
, the notepad prompts to create this Microsoft.PowerShell_profile.ps1 nonexistent file yet I see no file with this name in C:\Users\1999q\Documents\PowerShell
.
When I run New-Item -Path $PROFILE -Type File -Force
OR New-Item $PROFILE.CurrentUserCurrentHost
OR
if (!(Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
I get the error New-Item: Could not find file 'C:\Users\1999q\Documents\PowerShell\Microsoft.PowerShell_profile.ps1'.
.
Moreover, Test-Path $PROFILE
gives me False.
However, $PROFILE | Get-Member -Type NoteProperty | Format-List
displays the following:
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\1999q\Documents\PowerShell\profile.ps1
TypeName : System.String
Name : CurrentUserCurrentHost
MemberType : NoteProperty
Definition : string CurrentUserCurrentHost=C:\Users\1999q\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
I am unable to comprehend what exactly is going on, can anyone help me with this issue?