AWS System Manager is used to manage and operate resources on the cloud safely for the entire infrastructure. It offers the user to manage its working through a Run Command service using AWS Tools for PowerShell.
This guide will explain how to use AWS Tools for Windows PowerShell with the Run command.
Use the AWS Tools for Windows PowerShell with Run Command
Open the PowerShell from the system:
Explore the commands available for the AWS “System Manager” service:
Running the above command provide the list of commands which allows the user to communicate with the System Manager:
Get SSM Documents list in the table format by using this command:
Add a filter to the “Document Type” to only fetch records having “Command” as their value:
Sort the list in alphabetical order with respect to the “Name” field:
Get the contents for the “RunPowerShellScript” document in detail:
Build SSM run command containing comments and Document name with some parameters:
Key = 'tag:project'
Values = 'AWSPowerShell'
} -Parameter @{
commands = @(
'$NewDir = "C:\Amazon"'
'1..100 | % {Set-Content -Path "$NewDir\$PSItem.txt" -Value $PSItem}'
)
}
To verify that the run command is executed or not, head into the “System Manager” service:
Locate the “Run Command” from the left panel and click on it:
Open the “Command history” section and find the executed command listed there:
This is all about using AWS tools for PowerShell with Run Command.
Conclusion
To use AWS Tools for Windows PowerShell with the Run command, open the PowerShell from the system. Get the list of all the commands used to communicate with the System Manager. Optimize the table to get a more specific list by using filters and sorting on the list. Use the list to find the command to be used with the Run command and verify it from the dashboard. This guide has explained the use of AWS Tools for Windows PowerShell with the Run command.