I was so excited to see this but couldn't get pass the syntax errors. Every part errors
Msg 153, Level 15, State 1, Line 5
Invalid usage of the option AVAILABILITY_MODE in the CREATE AVAILABILITY GROUP statement.
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near '('.
Msg 319, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.