Delete log files:gc C:\Scripts\computers.txt | % { gci "\\$_\c$\WINDOWS" -Filter "kb*.log" } | ? { !($_.PsIsContainer) } | % { ri -force }
Delete $ntuninstall folders:gc C:\Scripts\computers.txt | % { gci "\\$_\c$\WINDOWS" -Filter "`$ntuninstall*" } | ? { $_.PsIsContainer } | % { ri -force }
Remove-Item appears to only be taking the filename instead of the file object. this should fix that
gc C:\Scripts\computers.txt | % { gci "\\$_\c$\WINDOWS" -Filter "kb*.log" } | ? { !($_.PsIsContainer) } | % { ri -path $_.FullName -force }
Delete $ntuninstall folders:gc C:\Scripts\computers.txt | % { gci "\\$_\c$\WINDOWS" -Filter "`$ntuninstall*" } | ? { $_.PsIsContainer } | % { ri -path $_.FullName -force }