我的脚本将一个目录(和所有子目录)复制到一个以今天的日期命名的新目录中,以复制到10个不同的服务器。复制项错误:无法遵循符号链接,因为它的类型被禁用
$ServerList = Get-Content 'C:\Users\test\Powershellskript\testservrar.txt'
ForEach ($Server in $ServerList)
{
$source = "\\$Server\C$\Java\testIX"
$distanation = "\\$Server\C$\Backup"
$today = (Get-Date).ToString('YY-MM-DD')
$location = New-Item -Path $distanation -Type Directory -Name $today
Copy-Item $source -Destination $location -recurse
}
但我得到了下面的两个错误,我该如何解决这个问题?
Copy-Item : The symbolic link cannot be followed because its type is disabled. At C:\Users\baa065sa\Powershell skript\Untitled1.ps1:9 char:1
Copy-Item : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. At C:\Users\baa065sa\Powershell skript\Untitled1.ps1:9 char:1
为什么?我怎样才能解释错误? –
对不起,代码没有格式化,当我张贴,并没有提供任何解释,我删除了我以前的评论 – Manu
它看起来像这里有一个解决方案:https://stackoverflow.com/questions/229643/how-doi-i-克服这个符号链接不能被遵循,因为它的类型是 –