Parsing Shortcuts in Powershell

ε祈祈猫儿з 提交于 2019-12-01 21:15:59

If you are on V3 or higher you can eliminate the reparse points like so:

Get-ChildItem "\\web1\c$\Web Sites\website" -Recurse -Attributes !ReparsePoint | 
    Copy-Item -Dest "D:\backup-temp\website.com files"

On V1/V2 you can do this:

Get-ChildItem "\\web1\c$\Web Sites\website" |
    Where {!($_.Attributes -bor [IO.FileAttributes]::ReparsePoint)} |
    Copy-Item -Dest "D:\backup-temp\website.com files" -Recurse

So it turns out that the issue I faces is explained in this Microsoft Blog Post: http://blogs.msdn.com/b/junfeng/archive/2012/05/07/the-symbolic-link-cannot-be-followed-because-its-type-is-disabled.aspx

Essentially on the server I am running the powershell script from I needed to run the following command: fsutil behavior set SymlinkEvaluation R2R:1

This allows Remote to remote symbolic links. Once this is in place the above powershell commands run as expected without errors.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!