Last active
October 29, 2018 08:30
-
-
Save markwragg/71b5407b878c4a8f9eca046d2585ca74 to your computer and use it in GitHub Desktop.
PowerShell / AWS CLI command to retrieve list of Amazon AMIs matching a partial name string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-AWSAMI { | |
[cmdletbinding()] | |
Param( | |
$Name = 'Windows_Server-2016-English' | |
) | |
$Images = aws ec2 describe-images --filters Name="name",Values="$Name" --region us-west-2 --owners amazon | |
($Images | ConvertFrom-Json).Images | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment