Extract EXIF metadata from photos with PowerShell
System.Drawing exposes each EXIF tag as a PropertyItem — read the shoot date, camera model, or GPS data straight from a JPEG.
01Command
$ Add-Type -AssemblyName System.Drawing; $img=[System.Drawing.Image]::FromFile('C:\Pictures\photo.jpg'); $img.PropertyItems | Select-Object Id, Type, Len | Format-Table; $img.Dispose()02What it does
Every PropertyItem has an Id (the EXIF tag number — 0x9003 is DateTimeOriginal, 0x0110 is CameraModel), a Type, Len, and a raw Value byte array you decode per the type (ASCII strings, shorts, rationals). This is more manual than a dedicated EXIF library but requires nothing installed. The same PropertyItems collection is writable, so scripts can also strip or overwrite tags before sharing photos — a lightweight privacy scrub.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- PropertyItem Class | Microsoft LearnEvidence: Microsoft documents System.Drawing.Imaging.PropertyItem with Id, Len, Type, and Value properties that hold image metadata (EXIF) items.
- Image Class (System.Drawing) | Microsoft LearnEvidence: Microsoft documents the Image.PropertyItems collection that exposes the metadata items stored in a loaded image.
Last verified: 2026-09-17 · Category: Media
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.