Getting Image Details

by Oct 7, 2009

PowerShell can access COM-Objects as there are many useful objects present on a system. For example, WIA.Image can return all kinds of useful information about images. The following lines show how to load an image file called pic.jpg, which resides in your Pictures folder and displays information such as image size:

$image = New-Object -comObject WIA.ImageFile
$image.LoadFile(
"$([System.Environment]::GetFolderPath('MyPictures'))\pic.jpg" )
$image

Twitter This Tip! ReTweet this Tip!