General-purpose PowerShell script for capturing any source directory into a Windows Image (.wim) file. This utility is designed to streamline the software staging process in enterprise environments by converting large file structures into compressed, mountable containers.
- Universal Capture: Optimised for any folder structure, including software source files, driver repositories, or OS components.
- Automatic Workspace Management: Automatically detects and creates the
C:\Wimoutput directory if it does not already exist. - Built-in Safety Checks:
- Admin Verification: Ensures the session has elevated privileges required for DISM operations.
- Path Validation: Verifies the existence of the source directory before execution to prevent process failure.
- Interactive CLI: Simple prompts for defining capture paths and file names.
- Operating System: Windows 10, Windows 11, or Windows Server.
- Permissions: Must be executed as Administrator (required for WIM capture).
- Dependencies: Requires the DISM (Deployment Image Servicing and Management) PowerShell module.
- Note: This is included by default on most Windows installations. If running in a "WinPE" or specialized environment, the Windows ADK may be required.
- Application Packaging: Converting large installation sources into WIMs to minimize local disk footprint during staging (e.g., LabVIEW, MATLAB, Autodesk).
- Infrastructure Management: Capturing file-based image components for OS deployment (OSD) workflows.
- Data Archiving: Compressing complex directory structures into a single, mountable file format.
- Open PowerShell as Administrator.
- Navigate to the script directory and execute the utility:
.\Build-Wim.ps1 - Input the Full Path of the folder you wish to capture when prompted by the CLI.
- Assign a Name for the resulting
.wimfile. - The script will execute the DISM capture and save the final image to
C:\Wim.
- Target Output:
C:\Wim - System Logs:
C:\Windows\Logs\DISM\dism.log
A professional automation utility for Application Packagers and System Administrators.