Clear SharePoint Recycle Bin using PowerShell

For one Site collection

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SPSiteurl = "<Site URL>"
$spsite = Get-SPSite -Identity $SPSiteurl
$files =$spsite.Recyclebin |?{$_.ItemState -eq 'SecondStageRecycleBin'}
foreach ($file in $files) {
$spsite.RecycleBin.Delete($file.ID)
}

For all site collections in a web application

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$WebApp=get-spwebapplication "https://yourappweb"
foreach ($SPSite in $webApp.Sites)
{
$files =$spsite.Recyclebin |?{$_.ItemState -eq 'SecondStageRecycleBin'}
foreach ($file in $files) {
$spsite.RecycleBin.Delete($file.ID)
}
}