Retrieving AWS EC2 instance screenshot with PowerShell
Few months ago, Amazon announced the ability to capture and show the console screen of an EC2 instance. It really helps troubleshooting in certain situations. While it is available through the GUI console, one has to explore further with the PowerShell way. ;-) Reading up on the AWS documentation, the AWS PowerShell cmdlet, Get-EC2ConsoleScreenshot , allows us to retrieve the image data. Let's give it a try in the PowerShell console. The result doesn't really look like an image, does it? Worry not, the data is actually a jpeg file encoded in BASE64 format. We just have to convert it back to bytes with the [convert]::FromBase64String() before saving the file. Now, opening up the saved screenshot. Oh well... this doesn't look perfect but good to know. I've put these together in a PowerShell function: Save-EC2consoleScreenshot. And now that's a pragmatic way to retrieve the EC2 instance screenshot! Feel free to have a look of it on GitHub: Link . Ho