Created
March 20, 2017 01:19
-
-
Save LawrenceHwang/043c6e3a7d0c5208f77021ab09832033 to your computer and use it in GitHub Desktop.
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
$instances = Get-ec2instance -Filter @(@{name = 'platform'; value = 'windows'}) | |
foreach ($i in $instances){ | |
$prop = @{ | |
Name = $i.Name | |
password = Get-EC2PasswordData -InstanceId $i.InstanceId -PemFile "C:\path\to\private\keys\$($i.KeyName).pem" | |
InstanceId = $i.instances.InstanceId | |
} | |
$obj = New-Object -TypeName psobject -Property $prop | |
$obj | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment