Here are a few options to automate and execute your PowerShell script on Windows EC2 instances from Jenkins:
Use Jenkins Powershell plugin to directly run the PowerShell script on the instances as part of your Jenkins job. You can specify the script path and target machines.
Install AWS CLI on your Jenkins server and use aws ssm send-command to invoke the script. Even though SSM doesn't directly support PowerShell, you can invoke cmd.exe to then execute the PowerShell script.
Use Jenkins to copy the PowerShell script to a shared location on the instances (e.g. S3) and then use aws ssm send-command to execute a cmd.exe script to download and invoke it.
Switch to using AWS RunCommand which is the successor to SSM documents for automating ops. It has better support for PowerShell scripts on Windows. Invoke the run command from Jenkins.
Use Jenkins Powershell plugin to copy the script to instances first, then use aws ssm send-command to invoke cmd.exe to execute the script locally.
Package the PowerShell script into an SSM document for Windows. This can then be executed directly using aws ssm send-command even if SSM doesn't natively support PS.
So in summary, combine Jenkins with AWS CLI and PowerShell plugins, SSM, RunCommand or cmd.exe invocation to automate running your Powershell administrative tasks on Windows from Jenkins.
- AWS OFFICIALUpdated 5 months ago
- How do I turn TDE off or on in my RDS for SQL Server instance and how do I troubleshoot common errors with it?AWS OFFICIALUpdated a year ago
- How do I add parameters when registering an Automation task with Systems Manager maintenance windows?AWS OFFICIALUpdated 3 years ago
- How do I automate the creation of AMIs based on my EBS-backed EC2 instance using Systems Manager Automation?AWS OFFICIALUpdated 2 years ago
- AWS Service Management Connector (SMC) introduces AWS Support and Automation integrations in Jira CloudEXPERTpublished 10 months ago
- EXPERTpublished a year ago