How do I create file hardlink in PowerShell on Windows 10?

对着背影说爱祢 提交于 2019-11-29 17:01:40

问题


How do I create file hardlink in PowerShell on Windows 10?

PSCX has New-Hardlink, but is it still needed on Windows 10?

You could always shell out to mklink, but from powershell that requires you prefix the command with cmd /c, which is ugly and hard to remember.


回答1:


New-Item -ItemType HardLink -Name CoverageCount.cs -Value ..\..\OPIAspnet5\Models\CoverageCount.cs

The ItemType parameter now includes a type for hardlinks, which I feel is a hidden gem of PowerShell on Windows 10.



来源:https://stackoverflow.com/questions/31863258/how-do-i-create-file-hardlink-in-powershell-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!