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
}