Get all the Alerts for a particular user using powershell

$site=Get-SPSite "http://serverName:22222/sites/TestSite/"
$web=$site.RootWeb
$user=$web.EnsureUser('domainName\userName')
$alertColl=$user.Alerts
foreach($alert in $alertColl)
{
 write-host -f Magenta $alert.Title
}