Skip to content

Instantly share code, notes, and snippets.

@lantrix
Created October 16, 2014 04:17
Show Gist options
  • Select an option

  • Save lantrix/904c7703b4c66c271149 to your computer and use it in GitHub Desktop.

Select an option

Save lantrix/904c7703b4c66c271149 to your computer and use it in GitHub Desktop.
AWS volumes attached to instance to delete
#method 1
$f = New-Object Amazon.EC2.Model.Filter
$f.Name = "attachment.instance-id"
$f.Value.Add("i-a005239e")
$voltodel = Get-EC2Volume -Filters $f
#method 2
$voltodel = Get-EC2Volume -Filters @{Name="attachment.instance-id"; Value="i-a005239e"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment