I created the file
C:\Users\<myname>\Documents\WindowsPowerShell\profile.ps1; however, PowerShell does not load it on launch. I have tested both the default PowerShell as well as VS Code's integrated PowerShell. I also tried renaming the
profile.ps1 file to
Microsoft.PowerShell_profile.ps1, but this changed nothing. I relaunched the applications in question after each change.
Test-Path $profile.CurrentUserAllHosts returns True.
The profile currently only contains one line (
Set-PSReadlineKeyHandler -Key Tab -Function Complete). After launching PowerShell or VS Code's integrated shell, running
Get-PSReadlineKeyHandler | findstr -i Tab reveals that it has not been set. Copying and pasting the line from the profile, running it, then running the
Get-... command again reveals that it is properly set, and the change does what it's supposed to. Relaunching the shell reverts back to the default.
Is there some other step I need to do to get PowerShell to execute the profile? (I come from a Linux/UNIX background and I assume PowerShell works similarly, but of course PowerShell is designed completely differently). If there is no extra step, why does PowerShell not load the profile in this case?
> $profile | Format-List * -force AllUsersAllHosts : C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 AllUsersCurrentHost : C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1 CurrentUserAllHosts : C:\Users\<myname>\Documents\WindowsPowerShell\profile.ps1 CurrentUserCurrentHost : C:\Users\<myname>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 Length : 76