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.
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.