开发者

PowerShell - Download files with WebDAV

I want to use PowerShell with WebDAV (https) to download multiple files from a folder. The name from the download files is unknown. So my plan is to download all files from this folder and create a cleaning job at the server.

At the moment I´m s开发者_运维百科earching for a good PowerShell with WebDAV example. Does anybody know a good example?


I don't try it but do you just test WebClient class?

PS > $source = "http://www.unsite.fr/untruc.zip"
PS > $destination = "c:\temp\untruc.zip" 
PS >
PS >$wc = New-Object System.Net.WebClient
PS >$wc.DownloadFile($source, $destination)

----Edited------ Do you try to dig into ADODB.stream com object as you cansee in : "PowerShell : Upload file to WebDav Server"


Take a look at: http://amarchuk.blogspot.com/2011/10/heres-c-webdav-client-that-works-with.html

You can store it as cs file, then call add-type to add it to powershell and from there on client.GetListItems to get names and then download all files recursively.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜