title: How to pass a powershell command to AWS SSM Document/Run Command using Terraform?
body: <p>I am trying to leverage the AWS-RunPowerShellScript SSM Document and pass a command through it, to run on Windows EC2 instances. I am having trouble figuring out how to pass the below Command to the Terraform.</p>
  <p><em>Command</em>
  <code>powershell.exe -ExecutionPolicy Bypass -file &quot;C:\aws\1-start-ebs-snapshot.ps1&quot;</code></p>
  <p>I need to run the command on EC2 instances using below SSM document.</p>
  <pre><code>resource &quot;aws_ssm_document&quot; &quot;run_powershell_cmd&quot; {
    name          = &quot;AWS-RunPowerShellScript&quot;
    document_type = &quot;Command&quot;
  
  }
  </code></pre>