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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With