Skip to content

How do you get command output from Invoke-ECSCommand? #264

Answered by ashishdhingra
JasonDictos asked this question in Q&A
Discussion options

You must be logged in to vote

@JasonDictos Invoke-ECSCommand CmdLet uses ExecuteCommand service API operation. AWS CLI behind the scenes appears to be using session manager plugin to display command output from ECS ExecuteCommand (refer StackOverflow post https://stackoverflow.com/questions/70367030/how-can-i-get-output-from-boto3-ecs-execute-command). ExecuteCommand response contains the details of the SSM session that was created for this instance of execute-command. With PowerShell, this automatic plumbing does not happen automatically (as with the other SDKs). To workaround this, you would need to use this session information and use Simple System Management API (.NET SDK or PowerShell) to get detailed output. Hop…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ashishdhingra
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. module/powershell-cmdlets
2 participants