如何在Windows 10上的PowerShell中创建文件硬链接? [英] How do I create file hardlink in PowerShell on Windows 10?

查看:349
本文介绍了如何在Windows 10上的PowerShell中创建文件硬链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows 10上的PowerShell中创建文件硬链接?

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

PSCX具有New-Hardlink,但是Windows 10上仍需要它吗?

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

您总是可以使用mklink进行操作,但是从powershell要求使用cmd /c作为该命令的前缀,这很丑陋且难以记住.

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

ItemType参数现在包括一种用于硬链接的类型,我认为这是Windows 10上PowerShell的一个隐藏的宝石.

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

这篇关于如何在Windows 10上的PowerShell中创建文件硬链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆