Wrong Windows 10 user path is being used by posh-git on git clone when posh-git is enabled in the Microsoft.PowerShell_profile.ps1 file.
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/powershell
Type 'help' to get help.
Loading personal and system profiles took 808ms.
me@mycomputername C:\..\..\thefolder Get-InstalledModule
2.0.468 oh-my-posh PSGallery Theming capabilities for the PowerShell prompt in ConEmu
0.7.3 posh-git PSGallery Provides prompt with Git status summary information and tab completion for Git commands, parameters, remotes and branch names.
The only line inside the Microsoft.PowerShell_profile.ps1 file:
Import-Module 'posh-git'
When this row is commented out the git clone works as expected.
me@mycomputername C:\..\..\thefolder git clone git@gitlab.com:<url>/<ToBeCloned>.git
Cloning into 'ToBeCloned'...
Could not create directory '/h//.ssh'.
The authenticity of host 'gitlab.com (<gitlab ip>)' can't be established.
ECDSA key fingerprint is SHA256:<fingerprint>.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Wrong Windows 10 user path is being used by posh-git on git clone when posh-git is enabled in the Microsoft.PowerShell_profile.ps1 file.
The only line inside the Microsoft.PowerShell_profile.ps1 file:
When this row is commented out the git clone works as expected.
Expected result:
Actual result: