Hello, i have a below script which is working very fine but now i need to EXCLUDEsome files which is started with prefix PHONE, PIN, SMS or with extension *.csv how can i do that.
BelowScript will delete all child folders and contents in a directory that are olderthan 30 days also and added in the two lines to stop it deleting any childfolders named "webserver" and "installer". Apart from thisi want to exclude some of the files asmentioned above.
PathC:\Program Files (x86)\RIM\BES\Logs"
FolderA - will be deleted as mentioned
FolderB - will be deleted as mentioned
webserver- exculded from deletion
installer- excluled from deletion
Nowthe files with prefix with phone, SMS, Call under Folder A & B should notbe deleted. How can i achieve that?
---------------------------------
$Today = Get-Date
$DaysToKeep = "30"
$TargetFolder = "C:\ProgramFiles...