I want to delete some files on multiple servers.How can i execute this commands on multiple server.
Remove-Item D:\vpm\* -include *sys.txt,error.txt,log.txt get-childitem D:\vpm\*.* -include *.txt
If i use
PsExec Remove-Item D:\vpm\* -include *sys.txt,error.txt,log.txt
i get an error saying "PsExec not a valid cmdlet.
I have also tried this code but this also doesn;t work.
Invoke-Command -computername "localhost" -Scriptblock { Remove-Item D:\vpm\* -include *sys.txt,error.txt,log.txt get-childitem D:\vpm\*.* -include *.txt }