Powershell script to monitor total members in AD group

I am trying to run the powershell script to monitor the total number of members in a group and alert if the number goes below 1100.

The script i am running "fails" but we get the accurate output of 1987

I am not good at powershell scripting, but what more do i need to do so we see that the script is critical <1100