Delete files on remote server
hi,
is there example delete files starting da*, , file extension dll , dla?
thanks,
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/del.mspx?mfr=true
stacy simpkins | mcse sharepoint | www.sharepointpapa.com
$session = new-pssession -computername myremoteserver1, myremoteserver2
invoke-command -session $session {del da*.dll}
invoke-command -session $session {del da*.dla}
these commands run del command on 2 remote servers named myremoteserver1 , myremoteserver2, sub server names
stacy simpkins | mcse sharepoint | www.sharepointpapa.com
actually documentation link incorrect. doc old dos/cmd del command whioch si built cmd.exe , cannot run powershell without cmd.exe
try these see mean.
cmd /c del /?
del /?
del -?
del in powershell runs remove-item.
the no need create whole buch of connectiosn when can @ once.
invoke-command -script { remove-item -path c:\test\* -include *.dll,*.dla -whatif } -computers comp1,comp2,comp3
sessions useful when need to maintain long term connections. sessions expensive.
¯\_(ツ)_/¯
Windows Server > Windows PowerShell
Comments
Post a Comment