Whenever I try to pull or clone a Git repository from PowerShell on Windows 11, the command fails with process exit code 34013391 (0x020700cf). The same kind of Git command works from a regular Command Prompt window, and I also saw a similar failure while trying to clone a repository for a container inside WSL. This seems to happen with multiple repositories rather than just one. I was using PowerShell 5.1.26100.8457. What could cause PowerShell Git commands to fail like this, and how can I troubleshoot it?
3 Answers
The command being executed matters here. A normal `git clone` or `git pull` should behave similarly regardless of whether it is launched from PowerShell or Command Prompt, but an installation script that downloads and runs a repository can involve additional shell and environment behavior. More detailed output from the failing Git command would help identify whether the failure comes from Git, credentials, networking, or the script.
PowerShell itself usually just launches the external Git executable, so the shell may not be the direct cause. First check whether the same command works with a specific repository, confirm which Git executable is being found with `Get-Command git`, and compare the Git and PATH settings between PowerShell and Command Prompt. For WSL, make sure the command is being run with the Linux Git installation and the appropriate shell or installer instructions rather than mixing Windows and WSL environments.
Reinstalling Git resolved the problem in this case. That likely repaired a damaged installation, PATH entry, or one of Git's bundled components. If it happens again, compare `git --version` and `Get-Command git` in both shells, then reinstall or repair Git and restart PowerShell so it reloads the updated environment.

It appeared to affect any repository I tried, while the same operation worked from Command Prompt.