import boto3

def lambda_handler(event, context):
    ssm_client = boto3.client('ssm', region_name="af-south-1") # use region code in which you are working
    response = ssm_client.send_command(
             InstanceIds=[
                "i-0adb9463103c3b57b" # use instance id on which you want to execute, even multiple is allowd
                     ],
             Targets = [{"Key":"InstanceIds","Values":["i-0adb9463103c3b57b"]}],
             DocumentName="AWS-RunPowerShellScript",
             Parameters={"commands":["c:\\rootfolder\\testbat.bat"],"workingDirectory":[""],"executionTimeout":["30"]},
    )
    # command_id = response['Command']['CommandId']
    # output = ssm_client.get_command_invocation(
    #      CommandId=command_id,
    #      InstanceId='i-0d8c8d46b34dd0c39',
    #    )
    #print(output)