Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Get-ECRLoginCommand' is not recognized as the name of a cmdlet, function, script file, or operable program

I am trying to download a Docker image from AWS and following the instructions at AWS I'm running:

(Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com

However, I'm getting the following error:

Get-ECRLoginCommand : The term 'Get-ECRLoginCommand' is not recognized as the name of a cmdlet, function, script file, or operable program.

How can I fix this error? I assume I need to install the module.

like image 811
sashoalm Avatar asked Sep 13 '25 06:09

sashoalm


2 Answers

After some searching, I realised I had omitted installing ECR when installing AWSTools. I had used these 2 commands:

Install-Module -Name AWS.Tools.Installer -Force
Install-AWSToolsModule AWS.Tools.EC2,AWS.Tools.S3 -CleanUp

So I installed it with:

Install-AWSToolsModule AWS.Tools.ECR

After that it worked.

like image 144
sashoalm Avatar answered Sep 15 '25 21:09

sashoalm


In my case, running this command on the AWS CLI instead of the AWS tool for Windows PowerShell worked.

aws ecr get-login-password --region [your region] | docker login --username AWS --password-stdin [your aws_account_id].dkr.ecr.[your region].amazonaws.com
like image 29
mitsu Avatar answered Sep 15 '25 21:09

mitsu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!