Will Snavely did a great job of writing these blog posts. you may find it useful when you need to monitor AlwaysOn health in your automation scenarios
Monitoring AlwaysOn Health with PowerShell - Part 1: Basic Cmdlet Overviewhttp://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-1.aspx
Monitoring AlwaysOn Health with PowerShell - Part 2: Advanced Cmdlet Usagehttp://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-2.aspx
Monitoring AlwaysOn Health with PowerShell - Part 3 : A Simple Monitoring Applicationhttp://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/monitoring-alwayson-health-with-powershell-part-3.aspx
Monitoring AlwaysOn Health with PowerShell - Part 4 : Integration with SQL Server Agenthttp://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/the-always-on-health-model-part-4.aspx