在 Windows 7 64 位上的 ConEmu 中的 Powershell 中的 Posh-Git 中我总是收到以下错误:
Resolve-Path : Cannot find path 'C:\wamp\www\MobileApps\Backbone\%HOMEPATH%' because it
does not exist.
At D:\Users\Andy\Documents\WindowsPowerShell\Modules\posh-git\GitUtils.ps1:265 char:13
+ $home = Resolve-Path (Invoke-NullCoalescing $Env:HOME ~)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\wamp\www\Mob...bone\%HOMEPATH%:String)
[Resolve-Path], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathComma
nd
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\Users\Andy\Documents\WindowsPowerShell\Modules\posh-git\GitUtils.ps1:266 char:29
+ Resolve-Path (Join-Path $home ".ssh\$File") -ErrorAction SilentlyContinue 2> ...
+ ~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationExc
eption
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Po
werShell.Commands.JoinPathCommand
有人能指出哪里出了问题吗?
编辑:添加设置 XML
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2013-10-19 18:24:13" build="131017">
...
<key name="Tasks" modified="2013-10-19 18:24:14" build="131017">
<value name="Count" type="dword" data="00000003"/>
<key name="Task1" modified="2013-10-19 18:24:14" build="131017">
<value name="Name" type="string" data="{cmd}"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Cmd1" type="string" data="cmd.exe "-new_console:d:%userprofile%""/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
<key name="Task2" modified="2013-10-19 18:24:14" build="131017">
<value name="Name" type="string" data="{Git Bash}"/>
<value name="GuiArgs" type="string" data=""/>
<value name="Cmd1" type="string" data=""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
<key name="Task3" modified="2013-10-19 18:24:14" build="131017">
<value name="Name" type="string" data="{Powershell 3}"/>
<value name="GuiArgs" type="string" data="/icon "%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe""/>
<value name="Cmd1" type="string" data="%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
</key>
</key>
<key name="Apps" modified="2013-10-19 18:24:14" build="131017">
<value name="Count" type="dword" data="00000000"/>
</key>
<key name="Colors" modified="2013-10-19 18:24:14" build="131017">
<value name="Count" type="dword" data="00000000"/>
</key>
</key>
</key>
</key>
答案1
您正在尝试在 64 位操作系统中使用 32 位 PowerShell。这不是 ConEmu 的问题,而是您的配置问题。请使用正确的 64 位 PowerShell。
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe