Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to download all the files from siteassets library using powershell, to a folder - D:\ Drive

$
0
0

How to download  all the files from siteassets  library using powershell, to a folder ( D:\ Drive )

Below code is not working:

 $destination = "F:\PoCSolutions\July7Timer\SITEASSETS"
$webUrl = "http://SRVR001:28516/"
$listUrl = "http://SRVR001:28516/lists/SiteAssets"
#Site Assets
##############################################################

$web = Get-SPWeb -Identity $webUrl
$list = $web.GetList($listUrl)

function ProcessFolder {
    param($folderUrl)
    $folder = $web.GetFolder($folderUrl)
    foreach ($file in $folder.Files) {
        #Ensure destination directory
        $destinationfolder = $destination + "/" + $folder.Url 
        if (!(Test-Path -path $destinationfolder))
        {
            $dest = New-Item $destinationfolder -type directory 
        }

 


Viewing all articles
Browse latest Browse all 7589

Trending Articles