Windows Server 2012 R2长文件路径不起作用?

时间:2017-01-11 19:22:04

标签: windows powershell

我们有一台服务器,使用ReFS为32k MAX_PATH功能安装了Windows Server 2012 R2,但它没有按预期工作,尤其是当您将其与Windows 10进行比较时。

如果您使用以下模式在Test-Path Powershell Windows 10使用非常长的UNC,请使用Test-Path -Path "\\?\UNC\hostname\share\very\long\path" -PathType Container

Windows Server 2012 R2

它将返回True但如果您在df.mean(level = 0) 中发出相同的命令,它将返回False。两个系统都使用最新版本的Powershell,两个系统都在注册表中启用了长路径。

知道为什么这个在Windows 10上运行而不是在Windows Server 2012 R2上运行吗?

1 个答案:

答案 0 :(得分:2)

对于Windows 10周年前更新计算机,有一种使用PSAlphaFS的解决方法。

在Windows 10之前,PowerShell / DotNet中未添加对长路径的支持。您可以看到here Long Path support was added to PowerShell in Windows 10 Anniversary Update