Skip to content

About

PowerShell toolkit to add and remove offline WIM drivers by tag, with JSON metadata tracking for repeatable image maintenance.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Wim Driver Tag Manager

PowerShell script for managing offline Windows image drivers by tag.

WimDriverTagManager.ps1 combines both workflows in one tool:

  • Add driver packages to a WIM image and assign a tag.
  • Remove all previously tracked drivers for a selected tag.

The script is designed for both interactive use and full parameter-based automation.

What It Does

  • Requires a .wim file as input.
  • Reads image information from the WIM and displays it at startup.
  • Uses a metadata JSON file in the same directory as the WIM.
  • Tracks drivers by tag so they can be removed as a group later.
  • Reuses an already mounted image if the mount path is already in use.
  • Supports both menu-driven and parameter-only usage.
  • Appends to a single persistent transcript log file.

Requirements

  • Windows 10 or Windows 11
  • PowerShell 5.1 or newer
  • Administrator privileges
  • DISM PowerShell cmdlets available

Files Created

For a WIM file like: D:\Images\install.wim

The script uses metadata in the same folder:

  • Preferred: D:\Images\WimDriverTagManager.json
  • Legacy fallback: D:\Images\install.json (used automatically if present)

Transcript log file (persistent, appended):

  • C:\Logs\WimDriverTagManager.log

Interactive Workflow

Run:

.\WimDriverTagManager.ps1 -WimFile "D:\Images\install.wim"

Interactive flow:

  1. Displays WIM file information.
  2. Displays existing tags and driver counts.
  3. Prompts for action:
    • A Add drivers
    • R Remove drivers by tag
    • Q Quit
  4. Add flow:
    • Browse for driver folder
    • Enter tag
    • Add and track new drivers
  5. Remove flow:
    • Select tag number
    • Confirm removal
    • Remove tracked drivers for that tag

Parameter-Only Usage

Add drivers

.\WimDriverTagManager.ps1 `
  -WimFile "D:\Images\install.wim" `
  -Index 1 `
  -Action Add `
  -DriverFolder "D:\Drivers\Firefly16G11" `
  -Tag "Firefly 16 G11"

Remove drivers by tag (with confirmation)

.\WimDriverTagManager.ps1 `
  -WimFile "D:\Images\install.wim" `
  -Index 1 `
  -Action Remove `
  -RemoveTag "Firefly 16 G11"

Remove drivers by tag (non-interactive)

.\WimDriverTagManager.ps1 `
  -WimFile "D:\Images\install.wim" `
  -Index 1 `
  -Action Remove `
  -RemoveTag "Firefly 16 G11" `
  -Force

Parameters

  • WimFile (required): Path to .wim file.
  • Index: WIM image index. Default is 1.
  • Action: Add or Remove.
  • DriverFolder: Folder containing driver INF files (used by Add).
  • Tag: Tag for newly added driver set (used by Add).
  • RemoveTag: Tag to remove (used by Remove).
  • Force: Skip Remove confirmation prompt.
  • MountDir: Offline mount path. Default C:\Mount.
  • LogFolder: Transcript directory. Default C:\Logs.
  • MetadataFile: Optional explicit metadata JSON path.

Tagging Best Practices

Use clear, stable tags so removals are predictable:

  • Device model, for example Firefly 16 G11
  • Driver bundle version, for example AudioPack 2026-07
  • Platform identifier, for example EliteBook840G10

Notes

  • If the image is already mounted at MountDir, the script will reuse it and will not dismount it automatically.
  • Keep the metadata JSON with the WIM to preserve tag history.
  • The script tracks driver IDs (oem*.inf) and supports legacy metadata entries.

Troubleshooting

"Image index was not found"

Use the correct -Index for your WIM.

"No tags exist in metadata"

Run an Add operation first to create tracked entries.

Drivers were added but count is zero

Ensure the selected folder contains valid INF-based driver packages and that DISM accepted them.

Access denied or mount errors

Run PowerShell as Administrator and verify no other process is locking the mount directory.

About

PowerShell toolkit to add and remove offline WIM drivers by tag, with JSON metadata tracking for repeatable image maintenance.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages