나는 작업을하는 데 사용 cmd.exe상금 10 만, 최근에는 파워 쉘로 전환.
와 cmd.exe두
cd %USERPROFILE%\example
과
git clone https://github.com/user/example.git %USERPROFILE%\example
의도 한대로 작동합니다. 이후 %USERPROFILE%PowerShell에서 작동하지 않습니다, 내가 사용하는 ~대신.
그러나 예를 들어 Powershell에 C:명령 cd ~/example을 입력하면 C:\Users\JohnDoe\example의도 한대로 폴더에있게됩니다 .
하지만 내가 달릴 때
git clone https://github.com/user/example.git ~/example
repo는 내 홈 디렉토리가 아니라에 복제됩니다 C:\~\example.
~Powershell에서 git clone 명령과 함께 사용할 수 있습니까?
또는
—
SimonS
$env:userprofile대신 사용하십시오%userprofile%
고맙습니다! 비록
—
jost21
$ExectionContext....일반적인 경로보다 더 많은 타이핑이 필요 하지만 ;) 나는 $env:userprofile지금 함께 갈 것이라고 생각 하지만, ~모든 경우에 작동 한다면 그것은 좋을 것입니다
나는 이것이 자식 때문이라고 생각합니까, 아니면 범인 Windows / Powershell입니까?
—
jost21
의도 한대로 작업
—
SimonS
~할 때 왜 사용해야 $env:userprofile합니까?
git clone https://github.com/user/example.git $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('~/example')