The reason why WIM is useful is that its hardware-independent, you can make them bootable using WIMBoot. Since Windows bootloader supports booting Windows from within a WIM file, it becomes easier to deploy.
How to Unmount or Discard a failed WIM
There are three ways to dismount or discard failed WIMs in bulk on a Windows system: You can use any of these methods, but the last one works with PowerShell 7 only.
1] Powershell Registry path method
Adam Gross, a Microsoft MVP, posted this method. You can use this method to find the location of all mounted images, extract the discard status, and then dismount each of them. However, this will bulk dismount discard failed WIMs one by one in sequence and takes around 25 seconds each.
2] Dismount-WindowsImage method
It is a PowerShell command which can be used to discard or save changes to a Windows image, and then dismount it. So it’s not just about failed ones, but also works for all. The best part is that it can save the state if you are planning to unmount a WIM temporarily. To Discard and dismount To Save and Dismount Sample Command
Path: specifies the location of the mounted Windows image.Append: Location of an existing .wim file to add the Windows image to when you dismount it instead of overwriting the existing image.CheckIntegrity parameter detects and tracks .wim file corruption.
So the final command will now look like (Thanks Manel) –
3] Bulk dismount discard failed WIMs using Windows PowerShell 7 Parallel method
It is available in preview and will be available with PowerShell 7. According to Merlin, this new method dismounted three images in just under 10 seconds instead of almost 25 seconds when ran in sequence. These are some of the best methods you can use to bulk dismount or discard failed WIMs in one go. While unmounting one doesn’t take much time, but this can be huge for Enterprise deployment. The parallel switch is going to be a life savior for many, as it is fifty percent faster compared to the sequential method.