I need a powershell line to delete all files in a folder excluding xml files.
Foldername:
d:\apps\Que
Subfolders should not be deleted
Thanks
>Solution :
Remove-Item supports native exclusion:
Remove-Item "d:\apps\Que" -Exclude *.xml
use -WhatIf to check what would be deleted without actually deleting it.