The EC2 Run Command (RunPowerShellScript) action runs a PowerShell script on targeted EC2 instances.

This action is designed for use with Windows-based EC2 instances only. To run a shellscript on Unix/Linux-based instances, use the EC2 Run Command (RunShellScript) action instead.

The EC2 Run Command (RunPowerShellScript) action uses the following endpoints:

Before you can use the EC2 Run Command (RunPowerShellScript) action, your EC2 instance must be ready to use with AWS Systems Manager.

The first step is to install the SSM Agent on your EC2 instance, unless your EC2 instance was based on an AMI that came with the SSM Agent pre-installed.

The second step is to provide AWS Systems Manager with the necessary permissions to send shellscripts to your targeted EC2 Instances.

We do not advise manually modifying the permissions attached to the cross-account role that is created by GorillaStack in AWS. GorillaStack updates this role with your permission when you change your account preferences, and this may cause any manual changes to be lost. Instead, follow the instructions provided in the AWS docs under “To create an instance profile for Systems Manager managed instances (console)”.