Following is the script to restart the timer service in SharePoint Farm

#region :- Restart Timer on all web front end servers
[array]$servers= Get-SPServer | ? {$_.Role -eq "Application"}
$farm = Get-SPFarm
foreach ($server in $servers)
{
Write-Host "Restarting Timer Job on $server"                         
$Service = Get-WmiObject -Computer $server.name Win32_Service -Filter "Name='SPTimerV4'"           
if ($Service -ne $null)            
{                
$Service.InvokeMethod('StopService',$null)
Start-Sleep -s 7
$service.InvokeMethod('StartService',$null)                
Start-Sleep -s 7
Write-Host "Timer Job successfully restarted on $server"           
}
else
{
write-host -ForegroundColor Yellow "Could not find Sharepoint 2010 Timer Service on $server"
}
}
#endregion