Azure Monitor Alert when VM is not available/Shutdown Down

Assuming you connected Virtual machine to Log Analytics already . Now You can run below powershell