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

查看:61
本文介绍了如何在 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 ....OPIAspnet5ModelsCoverageCount.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天全站免登陆