Skip to content

Instantly share code, notes, and snippets.

@markwragg
Last active October 29, 2018 08:30
Show Gist options
  • Save markwragg/71b5407b878c4a8f9eca046d2585ca74 to your computer and use it in GitHub Desktop.
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
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