Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Remove-Item command for all window profiles

$
0
0

I wanting to delete all files and folders from the desktop under all window profiles. 

I also want to keep a few .ppt that have specific names for under each profile.  Below is what I have tried and using -exclude "AppV" as an example.  Nothing works.

Remove-item -Path C:\$users\desktop\*.* -exclude "AppV" -force -erroraction 'silentlycontinue'

Remove-item c:\users\wcampbell\desktop\* -exclude "AppV" -force -erroraction 'silentlycontinue'

Remove-item C:\$users\desktop -exclude "AppV" -force -erroraction 'silentlycontinue'


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>