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.

WindowsexifmediapowershellLow risk
Load the image with System.Drawing and enumerate `$img.PropertyItems`, then decode the Value bytes for the tag IDs you need.

01Command

Command
$ 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

RiskLow risk
RequirementsPropertyItem values are raw bytes; interpret well-known IDs (e.g. 0x0132 DateTime) or via the System.Drawing.Imaging.PropertyItem docs.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • PropertyItem Class | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents System.Drawing.Imaging.PropertyItem with Id, Len, Type, and Value properties that hold image metadata (EXIF) items.
  • Image Class (System.Drawing) | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: 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