Install SSM Agent on Amazon EC2 Windows instance at launch

I want to know how to install AWS Systems Manager Agent (SSM Agent) on an Amazon Elastic Compute Cloud (Amazon EC2) Windows instance at launch. I also want to keep the SSM Agent up to date.