PowerShell -WebClient DownloadFile Wildcards?

后端 未结 3 855
说谎
说谎 2021-01-22 12:11

I want to copy multiple files from a SharePoint libary to a local directory. It is possible to use Wildcards? The following code is not working. But is there a way to use the We

3条回答
  •  野性不改
    2021-01-22 12:53

    What about using WEBDAV?

    c:\> copy \\my.sharepoint.site\sites\foo\doclib\*.jpg c:\temp\
    

    If the client end (i.e. not sharepoint) is a server 2008+ platform, you'll need to add the "desktop experience" role and enable the "webclient" service. This is not the same thing as system.net.webclient; it's the HTTP/DAV network redirector service.

    If you need to log in with different credentials, you can use this:

    c:\> net use * "http://my.sharepoint.site/sites/foo/doclib" /user:foobar
    mapped h: to ...
    c:\> copy h:\*.jpg c:\temp
    

    Hope this helps.

提交回复
热议问题