by willbs at 2013-04-10 12:53:50
i have this command for exampleby ArtB0514 at 2013-04-10 12:59:21
remove-item -path C:\serverfolders\users*
i want to delete all of files in the "users" folder but i don’t want to delete any subfolders whose names are unknown to me, any ideas?
is there an -exclude folders type command?
Version 2:by willbs at 2013-04-10 13:40:25Get-Childitem C:\serverfolders\users* | Where-Object {-Not $.PSIsContainer} | Foreach-Object {Remove-Item $.FullName}
Version 3:Get-Childitem C:\serverfolders\users* -File | Foreach-Object {Remove-Item $_.FullName}
that’s a bingo, thanks Artby ArtB0514 at 2013-04-10 13:44:43
You’re very welcome.