Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save murarisumit/7701cb24bee275d035d1 to your computer and use it in GitHub Desktop.
Save murarisumit/7701cb24bee275d035d1 to your computer and use it in GitHub Desktop.
AWS powershell get all instance private IP
$instances = (Get-ec2instance -region us-east-1 ).Instances
$servers = @()
foreach( $instance in $instances) {
$ipAddrs+=$instance.PrivateIpAddress
}
foreach ($ip in $ipAddrs) {
write-host $ip
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment