问题
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