Created
February 4, 2015 00:06
-
-
Save ciphertxt/67bf0d2cf5192da88762 to your computer and use it in GitHub Desktop.
Get's the latest Windows Server image for EC2 provisioning
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
Import-Module AWSPowerShell | |
Function Get-EC2LatestWindowsServerAMI | |
{ | |
return Get-EC2Image | ? { $_.Platform -eq "Windows" -and $_.ImageOwnerAlias -eq "amazon" -and $_.Name -like "*Windows*Server*2012*R2*English*Base*" } | Sort-Object -Property CreationDate -Descending | Select-Object -First 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment