I have a website that needs frequent backup hence I would like to write a script to compress all the files in the screenshot. Except:
- All the contents in the image folder (See Highlighted)
- Any *.log files in the entire directory
I tried to get a list of files and always end up having the image folders contents:
$WebAppFolder = 'C:\ReleaseBackupScript\MyWebSite'
$filteredList = Get-childitem -path $WebAppFolder -exclude $WebAppFolder"\image",*.log -Name -recurse -force
Out-File -FilePath FilteredList.txt -InputObject $filteredList
