Got a challenge from 2Pint in the form of adding BC-support to WinPE Images through the use of a driver earlier this year… I managed to do just that a couple of weeks later.
But for a whole lot of reasons that still wasn’t a viable option so started to look at ways of doing in from within WinPE.
Now I have finally found a way that 2pint and I has agreed upon being ok to share. With that being said, 2pint hasn’t seen the script that I’m about to post and if they or MS wants me to delete this post and the associated files, I’ll do it as fast as I possibly can.
2PintSoftware are the ones who made the WinPEGen, I just found another way of using it.
Make sure to visit their site and see what other goodies they have in store.
Edit1:
Been getting some feedback and if the newest ACP works for you, you shouldn't use the old one. I've left out the parts belonging to 2Pint's OSD toolkit. For more info about those steps it's better to look at their documentation. If you're intressted in trying out some work in progress I've made a couple of (necessary) improvements to the script.
Edit2:
The boot image needs to have .NET, dism and powershell prior to this adaptation .
Main post
I think I covered most of what the script is doing in the comments within it so what that is missing is how and when to use it…
This location was chosen since I want to make sure that the download of the boot image is done after the format but before it is staged for the first time.
I think I've managed to verify wrong/old-media-, PXE- and the Refresh (Win10)-scenarios.
This is how my sequence looks like:
The Wim Share
A shared folder with subdirectories with the name of OS-build versions. Each subdirectory containing an “Install.wim” from a Win10-iso for the build number in question.
My script is checking the boot image version and is trying to locate a wim with the files WinPEGen needs. It doesn't need to have a drive letter, an UNC-path works as well. Even though WinPEGen mounts this wim it's just an mount point. The file won't be downloaded so to speak.
16299 = '1709'
17763 = '1809'
18362 = '1903'
Download WinPEGen-pkg
Downloads a WinPEGen pkg that I've created with my Add-BCToLocalWim.ps1 as an addition to the original files. Saves the path to a variable that is used later on.
This is how the root folder of the package looks like.
WinPEGen is found in 2Pint’s OSD toolkit Download:
Add BC to bootimage:
Where I: is the drive letter used when mapping the Wim-Share.
Restart Computer, in this group, only runs if _SMSTSInWinPE equals true.
Enable Branch Cache
(BCGood2Go is set by Add-BCToLocalWim.ps1)
This is the usual 2pint-part of the sequence, with bcenabler and so on. For details, check out 2pints documentation.
I’m copying the old ACP since the latest one I have freezes at the very begining of trying to start a download. The old one however seems to crash from time to time. The error I’m seeing is “Unable to create BITS-ComObject” but never on the first download. So I know that BC, BITS and the ACP works. Might have something to do with releasing resources afterwards but I'm not sure.
If the latest ACP works for you don't change to the old one.
I've put the old one in the x64-folder of the WinPEGen-Pkg.
You can ofc put it anywhere you want to.
I'm copying the old ACP with this command:
(Not vital)
The rest of the BC parts in the sequence can be downloaded here:
Add-BCToLocalWim.ps1 can be found here:
Comments