sorry to jump in: 1. The Root Cause Look at this line in Master.ps1: Code: powershell $script:ProjectRoot = [System.IO.Path]::GetFullPath((Join-Path $script:ScriptsDir "..\..")) Notice the prefix: $script: Now look at this line in sub_Mount.ps1: Code: powershell $DiscoverIso = @(Get-ChildItem -LiteralPath $global:ProjectRoot -Filter "*.iso" -File) Notice the prefix: $global: That's the bug. Master parked the car in the "Script" parking spot. sub_Mount is looking for it in the "Global" parking spot. Different lots 2. Why Did It Only Blow Up Now? Because Master.ps1 has this at the very top: Code: powershell Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest throws a terminating error the moment an undefined variable is read. So in a weird way, StrictMode saved you by stopped everything immediately and said "Hey, that variable doesn't exist." That's why you got a clear error message right away. Minimal fix: Code: Add 2 lines after root definition: $global:projectRoot = $script:projectRoot (plus ScriptsDir and DataDir) Good lesson, I'm learning. Happy coding. Cheers
Thank you very much for your invaluable help in revising my script. Of course, I’ll take all your comments into account. The only thing I don’t understand is how this could be happening: I’ve run this script through many times and haven’t encountered any problems with it. But people are writing that they can’t get it to run. Using the tool itself requires minimal effort—it doesn’t get any easier than that—yet it doesn’t work for them. How can this be? Miracles don’t happen... To say that I’m learning this too would be an exaggeration. Because while .cmd is already second nature to me, when it comes to PowerShell, I’m still just taking my first steps. PowerShell is a really interesting topic for me, so I’m trying to get the hang of it. So far, it’s been a bit of a struggle—I guess the first pancake always comes out lumpy...
Damn, you're just shocking me! So, in the DVD\sources folder, we get a .wim file, and in the .iso folder, the ISO file will be in .esd format. I'm currently testing a version of the tool with an extended menu that will allow you to choose whether or not to create an ISO image. I'll post it once I've finished testing it.
You don't need to have both WIM and ESD files. This takes quite a long time, especially with ntlite. We look forward to the new version.
There's no point in working with the ISO; it takes too long. It would be faster using just the install.wim file. That's just my opinion, though—it's up to you.
You might think it's pointless, but it's for experienced users. This tool is designed for a wider range of users, and that's why it works not only with install.wim but also with boot.wim, reducing its size by half. Furthermore, the user has the option of creating a DVD image for further editing with other programs, or, for inexperienced users, creating an ISO image in addition to the DVD. I don't think there's anything wrong with this for the end user. This tool wasn't created for any particular personal purpose, but for a wide range of users with varying levels of experience. In other words, this tool was created primarily with you, the average user, in mind.
First pic is the optimized mounted ISO, second pic is the original mounted ISO. Thanks for all of your efforts!
You’re right. Your script is for the average user, who wants everything to be ready to go and to create a modified operating system with a single click. I don’t think I’m one of them. I want to have the choice of what to keep and what to remove from the original operating system. That’s why I prefer SunLion’s script. I have nothing against your script. It’s good, and I hope it gets even better so more average users can benefit from it. Good luck with the project.
Hmm, that's weird, I don't even know what to tell you about this. I've tested the tool numerous times and haven't encountered any errors in the script, so it wasn't meant to be ... If anything, I can send you a screenshot of the walkthrough of this part of the scenario.
If the original ISO is `zh-cn_windows_11_enterprise_ltsc_2024_x64_dvd_cff9cd2d.iso`, then `Language.Basic~~~zh-CN~0.0.1.0` cannot be removed. If you retain only English and Russian in WimOptimizer_25.11.5—thereby marking zh-CN as a redundant language to be stripped—and the original ISO is `zh-cn_windows_11_enterprise_ltsc_2024_x64_dvd_cff9cd2d.iso`, this error will occur.
I think I understand where this is coming from: the tool was created for myself, and so the script will remove all languages except English and Russian from the image. To fix this, you need to go to Data\Fils and remove or comment out the # language for your region in the CapabilityList.txt file. I somehow didn't think of this right away - thank you for this important note! I have added this information to my ad.