After upgrading my Windows 10 OS layer from 1511 to 1607 I noticed the size of my OS Layer became 38GB. I decided to finally figure out how to compress layers by zero out deleted blocks in the VM then using vmkfstools to punch the blocks out of the vmdk. The resulting layer was only 15 GB.
I then wrote a blog (to be released soon) describing how to do it.
My boss then challenged mne to develop automation around the process so I created this utility whcih allows you to compress every layer you arte about to finalize. Most layers only shrink a little in soze maybe a third of the layer but it does allow you to keep layers as small as possible.
This is the first version of this utility. I have tested it but no one else has. Please test any layers you create prior to rolling them out to real users.
Here is the documentation
Here is the utility
Update Ver 1.1 10-31-2016
Shane found a bug in the MA test scripting.
Update ver 1.2 11-2-2016
Another small bug fix plus i added to the documentation that you must enable ssh on the host and allow ssh through the firewall.
Update ver 1.3 11-6-2016
Thanks to help from several csutomers I fixed a bug when using edit latest version which would show some strane results when you retirieved the running install machines. I also changed how i look for the attached disk on teh console machine to check the disk label to make sure it matches the disk we attached. Lastly i leave open the powershell window in case you want to review any errors. But rmember errors woud eb listed in the log file as well.
Update 1.31 11-8-2016
I small change i thought i had made already. If you have set this up you just need to update the compress.ps1 file.
Update 2.0 12-9-2016
Some user had issues wiht the way to utility determined which disk on the console machine to process. I reworked the logic for that so it would work universally.
Update 2.1 12-16-2016
My last update was not sufficient to fix the issue where the filenames didnt match from our database to the layer. This version now chooses the last disk attached to the Install Machine as the disk to modify. This seems to always work.
I added the ability to compress UEP disks for persistent desktops. Please read the documentaiotn carefully and test first on desktops of non-real users. I have tested wiht OK resutls. I saved about 1-2 GB per desktop for UEP disks.
As always after you download the zip edit the properties and unblock the zip before extracting it.
Let me know how it works for you if you try it.