copy Service pack and cu files in multiple server


To copy large files to SharePoint servers can be pain ful e.g. if  you are on monthly patch mode or have large farms.  below script can automated that.

# robocopy.exe source destination /mirror
$Servers = @("ServerA", "ServerB", "ServerC")
foreach($Server in $Servers)
{
    $Location = "\\$Server\e$\Binaries\SP2013SP1"
    Write-Host $Location
    Robocopy.exe E:\Binaries\SP2013SP1\ $Location /MIR 

}

##### OR ######

$Servers = Get-SPServer | ? { $_.Role -eq "Application" -or $_.Role -eq "WebFrontEnd"}
foreach($Server in $Servers)
{
    $Location = "\\$Server\e$\Binaries\SP2013SP1"
    Write-Host $Location
    Robocopy.exe E:\Binaries\SP2013SP1\ $Location /MIR 

}