Last active
April 6, 2019 01:03
-
-
Save MatthewJDavis/d7cdf0c32d28ea69971b5a56841ae108 to your computer and use it in GitHub Desktop.
output an AWS subnet(s) with name tag
This file contains hidden or 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
| # Very basic, works if only name tag is set | |
| Get-EC2Subnet| ForEach-Object { | |
| $properties = [ordered]@{ | |
| AZ = $_.availabilityzone | |
| SubnetID = $_.subnetid | |
| Name = ($_ | Select-Object -ExpandProperty Tags).value | |
| CidrBlock = $_.cidrblock | |
| } | |
| New-Object -TypeName PSObject -Property $properties | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment