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.
- Requires a
.wimfile 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.
- Windows 10 or Windows 11
- PowerShell 5.1 or newer
- Administrator privileges
- DISM PowerShell cmdlets available
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
Run:
.\WimDriverTagManager.ps1 -WimFile "D:\Images\install.wim"Interactive flow:
- Displays WIM file information.
- Displays existing tags and driver counts.
- Prompts for action:
AAdd driversRRemove drivers by tagQQuit
- Add flow:
- Browse for driver folder
- Enter tag
- Add and track new drivers
- Remove flow:
- Select tag number
- Confirm removal
- Remove tracked drivers for that tag
.\WimDriverTagManager.ps1 `
-WimFile "D:\Images\install.wim" `
-Index 1 `
-Action Add `
-DriverFolder "D:\Drivers\Firefly16G11" `
-Tag "Firefly 16 G11".\WimDriverTagManager.ps1 `
-WimFile "D:\Images\install.wim" `
-Index 1 `
-Action Remove `
-RemoveTag "Firefly 16 G11".\WimDriverTagManager.ps1 `
-WimFile "D:\Images\install.wim" `
-Index 1 `
-Action Remove `
-RemoveTag "Firefly 16 G11" `
-ForceWimFile(required): Path to.wimfile.Index: WIM image index. Default is1.Action:AddorRemove.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. DefaultC:\Mount.LogFolder: Transcript directory. DefaultC:\Logs.MetadataFile: Optional explicit metadata JSON path.
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
- 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.
Use the correct -Index for your WIM.
Run an Add operation first to create tracked entries.
Ensure the selected folder contains valid INF-based driver packages and that DISM accepted them.
Run PowerShell as Administrator and verify no other process is locking the mount directory.