Home
%3CLINGO-SUB%20id%3D%22lingo-sub-984756%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Windows%2010%20media%20with%20Dynamic%20Update%20packages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-984756%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20want%20easy%20mode%20version%20of%20this%20go%20get%20OSDBuilder%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fosdbuilder.osdeploy.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fosdbuilder.osdeploy.com%2F%3C%2FA%3E%26nbsp%3Band%20it%20does%20all%20of%20the%20above%20and%20more%20in%20an%20automated%20fashion.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-987337%22%20slang%3D%22en-US%22%3ERe%3A%20Updating%20Windows%2010%20media%20with%20Dynamic%20Update%20packages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-987337%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20Steve.%20I'm%20afraid%20this%20blog%20post%20is%20two%20years%20late.%20For%20one%20thing%2C%20dynamic%20updates%20have%20not%20been%20released%20for%20a%20year%20now.%20v1903%20and%20v1909%20do%20not%20have%20them.%20For%20another%2C%20we've%20developed%20our%20own%20in-house%20scripts%20by%20now.%20At%20least%2C%20you%20could%20have%20properly%20formatted%20your%20code%20either%20with%20syntax%20highlighting%20or%20with%20the%20HTML%20%3CCODE%3E%20tag.%3C%2FCODE%3E%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20your%20Get-TS%20function%20is%20unnecessary.%20Get-Date%20%22HH%3Amm%3Ass%22%20does%20the%20same%20thing.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-982477%22%20slang%3D%22en-US%22%3EUpdating%20Windows%2010%20media%20with%20Dynamic%20Update%20packages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-982477%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIn%20the%20recent%20blog%20entitled%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWindows-IT-Pro-Blog%2FThe-benefits-of-Windows-10-Dynamic-Update%2Fba-p%2F467847%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EThe%20benefits%20of%20Windows%2010%20Dynamic%20Update%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F322841%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EMonika%20Sinha%3C%2FA%3E%20provided%20an%20overview%20of%20Dynamic%20Update%2C%20the%20benefits%20of%20enabling%20it%2C%20how%20it%20works%2C%20and%20how%20to%20manage%20this%20content%20in%20a%20managed%20environment.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFor%20IT%20pros%20that%20want%20to%20have%20these%20updates%20applied%20to%20their%20Windows%2010%20image%20prior%20to%20deployment%2C%20they%20need%20to%20understand%20how%20Dynamic%20Update%20packages%20can%20be%20acquired%20and%20applied%20to%20their%20image.%20This%20blog%20will%20walk%20through%20the%20steps%20for%20acquiring%20and%20applying%20Dynamic%20Update%20packages%2C%20showcasing%20a%20sample%20PowerShell%20script.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-1852464926%22%20id%3D%22toc-hId-1852464926%22%3EDynamic%20Update%20refresher%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EAs%20soon%20as%20a%20Windows%2010%20feature%20update%20initiates%2C%20whether%20from%20media%20or%20a%20Windows%20Update%20service-connected%20environment%2C%20Dynamic%20Update%20is%20one%20of%20the%20first%20steps%20invoked.%20Windows%2010%20Setup%20reaches%20out%20to%20an%20Internet-facing%20URL%20hosted%20by%20Microsoft%20to%20fetch%20Dynamic%20Update%20content%2C%20then%20applies%20those%20updates%20to%20your%20OS%20installation%20media.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EContent%20acquired%20includes%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%20margin-top%3A%2020px%3B%22%3E%3CSTRONG%3ESetup%20Updates%3C%2FSTRONG%3E%3A%20Fixes%20to%20Setup%20binaries%20or%20any%20files%20that%20Setup%20uses%20for%20feature%20updates.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3ESafe%20OS%20Updates%3C%2FSTRONG%3E%3A%20Fixes%20for%20the%20%22safe%20OS%22%20that%20are%20used%20to%20update%20Windows%20recovery%20environment%20(WinRE).%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3EServicing%20Stack%20Updates%3C%2FSTRONG%3E%3A%20Fixes%20that%20are%20necessary%20to%20address%20the%20Windows%2010%20servicing%20stack%20issue%20and%20thus%20required%20to%20complete%20the%20feature%20update.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3ELatest%20Cumulative%20Update%3C%2FSTRONG%3E%3A%20Installs%20the%20latest%20cumulative%20quality%20update.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3EDriver%20Updates%3C%2FSTRONG%3E%3A%20Latest%20version%20of%20applicable%20drivers%20that%20have%20already%20been%20published%20by%20manufacturers%20into%20Windows%20Update%20and%20specifically%20targeted%20for%20Dynamic%20Update.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIn%20addition%20to%20these%20updates%2C%20Dynamic%20Update%20will%20preserve%20Language%20Pack%20(LP)%20and%20Features%20on%20Demand%20(FODs)%20content%20during%20the%20upgrade%20process.%20These%20are%20not%20updates%20to%20LPs%20and%20FODs%2C%20but%20reacquisition%20to%20ensure%20the%20user%20has%20these%20elements%20present%20with%20the%20update%20completes.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFor%20some%20environments%2C%20enabling%20acquired%20Dynamic%20Update%20content%20and%20installing%20that%20content%20on%20the%20device%20is%20not%20an%20option.%20For%20example%2C%20the%20device%20may%20not%20have%20internet%20connectivity.%20If%20one%20is%20performing%20a%20media-based%20feature%20update%2C%20most%20Dynamic%20Update%20content%20can%20be%20acquired%20and%20applied%20to%20the%20image%20before%20initiating%20setup%20on%20the%20device.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ELet's%20briefly%20walk%20through%20the%20high-level%20steps.%20Then%2C%20we'll%20look%20at%20how%20to%20perform%20these%20steps%20using%20a%20PowerShell%20script.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--699692035%22%20id%3D%22toc-hId--699692035%22%3EAcquiring%20the%20content%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EVisit%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.catalog.update.microsoft.com%2FHome.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Update%20Catalog%3C%2FA%3E%20and%20acquire%20the%20Dynamic%20Update%20cumulative%20content%20packages%20used%20to%20apply%20to%20the%20image.%20At%20the%20main%20search%20bar%2C%20searching%20for%20%22%221809%20Dynamic%20Update%22%20will%20show%20a%20listing%20as%20follows%3A%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F156602iDDD8167C0B3F7EAE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22update-catalog.png%22%20title%3D%22update-catalog.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIt%20appears%20that%20there%20is%20a%20Safe%20OS%20Dynamic%20Update%20available%20to%20download.%20However%2C%20what%20about%20the%20other%20packages%3F%20To%20understand%20how%20to%20map%20these%20search%20results%20requires%20closer%20inspection%20of%20each%20%3CEM%3ETitle%3C%2FEM%3E%2C%20%3CEM%3EProduct%3C%2FEM%3E%20and%20%3CEM%3EDescription%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EThe%20below%20table%20shows%20you%20how%20to%20differentiate%20each%20type%20of%20Dynamic%20Update%20package%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CTABLE%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%20style%3D%22background-color%3A%20%230078d4%3B%22%3E%0A%3CTD%20width%3D%22100px%22%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EDU%20Content%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3ETitle%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EProduct%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EDescription%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3ESafeOS%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E2019-08%20Dynamic%20Update...%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EWindows%2010%20Dynamic%20Update%2CWindows%20%3CSTRONG%3ESafe%20OS%20Dynamic%20Update%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EComponentUpdate%3A%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3ESetup%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E2019-08%20Dynamic%20Update...%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EWindows%2010%20Dynamic%20Update%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E%3CSTRONG%3ESetupUpdate%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3ELCU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E2019-08%20%3CSTRONG%3ECumulative%20Update%20for%20Windows%2010%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EWindows%2010%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EInstall%20this%20update%20to%20resolve%20issues%20in%20Windows...%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3ESSU%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E2019-09%20%3CSTRONG%3EServicing%20Stack%20Update%20for%20Windows%2010%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EWindows%2010...%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EInstall%20this%20update%20to%20resolve%20issues%20in%20Windows...%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIn%20order%20to%20customize%20the%20OS%20image%20with%20additional%20languages%20or%20FODs%2C%20have%20the%20OS%20supplemental%20media%20ISOs%20available%2C%20which%20are%20downloadable%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Flicensing%2Fservicecenter%2Fdefault.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Volume%20Licensing%20Service%20Center%3C%2FA%3E.%20For%20example%2C%20since%20Dynamic%20Update%20will%20be%20disabled%20for%20your%20devices%2C%20and%20should%20users%20require%20specific%20FODs%2C%20these%20can%20be%20preinstalled%20into%20the%20image.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-1043118300%22%20id%3D%22toc-hId-1043118300%22%3EPatching%20the%20Windows%2010%20installation%20media%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ENow%20we%20can%20work%20on%20how%20the%20packages%20and%20acquired%20supplemental%20media%20can%20be%20used%20to%20patch%20Windows%2010%20OS%20media.%20To%20get%20started%2C%20let%E2%80%99s%20look%20at%20the%20high-level%20steps%20we%E2%80%99ll%20perform%20using%20PowerShell.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EThe%20table%20below%20shows%20the%20steps%20(as%20rows)%20that%20are%20executed%20against%20a%20target%20(as%20columns).%20Many%20of%20these%20tasks%20are%20repeated%20for%20target.%20For%20example%2C%20tasks%20that%20are%20repeated%20for%20each%20of%20the%20multiple%20Windows%20image%20files%2C%20such%20as%20applying%20SSU%20DU%2C%20cleaning%20the%20image%2C%20and%20exporting%20the%20image.%20The%20targets%20of%20these%20actions%20are%20as%20follows%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%20margin-top%3A%2020px%3B%22%3E%3CSTRONG%3EWinPE%3A%3C%2FSTRONG%3E%20The%20Windows%20Preinstallation%20Environment%20(WinPE)%20is%20a%20small%20operating%20system%20used%20to%20install%2C%20deploy%2C%20and%20repair%20Windows%2010%20desktop%20editions%2C%20Windows%20Server%2C%20and%20other%20Windows%20operating%20systems.%20From%20WinPE%2C%20it%E2%80%99s%20possible%20to%20set%20up%20a%20hard%20drive%20before%20installing%20Windows%2C%20install%20Windows%20by%20using%20apps%20or%20scripts%20from%20a%20network%20or%20a%20local%20drive%2C%20or%20capture%20and%20apply%20Windows%20images.%20Further%2C%20it%E2%80%99s%20possible%20to%20modify%20the%20Windows%20operating%20system%20while%20it's%20not%20running%2C%20set%20up%20automatic%20recovery%20tools%2C%20recover%20data%20from%20unbootable%20devices%2C%20and%20add%20a%20custom%20shell%20or%20GUI%20to%20automate%20tasks.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3EWinRE%3A%3C%2FSTRONG%3E%20The%20Windows%20Recovery%20Environment%20(WinRE)%20repair%20common%20causes%20of%20unbootable%20operating%20systems.%20WinRE%20is%20based%20on%20Windows%20Preinstallation%20Environment%20and%20can%20be%20customized%20with%20additional%20drivers%2C%20languages%2C%20Windows%20PE%20Optional%20Components%2C%20and%20other%20troubleshooting%20or%20diagnostic%20tools.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3EMain%20OS%3A%3C%2FSTRONG%3E%20The%20main%20OS%20is%20one%20or%20more%20Windows%2010%20editions%20stored%20within%20%5Csources%5Cinstall.wim.%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CSTRONG%3EMedia%3A%3C%2FSTRONG%3E%20Media%20in%20the%20table%20below%20represents%20the%20complete%20collection%20of%20files%20and%20folders%20in%20the%20Windows%2010%20installation%20media.%20For%20example%2C%20%5Csources%20folder%2C%20%5Cboot%20folder%2C%20setup.exe%2C%20etc.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CTABLE%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%20style%3D%22background-color%3A%20%230078d4%3B%22%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EWinRE%20(winre.wim)%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EWinPE%20(boot.wim)%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EMain%20OS%20(install.wim)%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3ENew%20media%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20SSU%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E9%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E18%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20Lang%20Pack%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E19%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20Localized%20Optional%20Components%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E11%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20Font%20Support%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E4%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E12%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20TTS%20Support%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E5%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E13%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EUpdate%20Lang.ini%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E14%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20FOD%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E20%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20.Net%20Cumulative%20Updates%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E21%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20Safe%20OS%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E6%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20Setup%20DU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E25%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EAdd%20LCU%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E15%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E22%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EClean%20Image%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E7%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E16%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E23%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EExport%20Image%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E8%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E17%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%3CP%3E24%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--1509038661%22%20id%3D%22toc-hId--1509038661%22%3EHandling%20multiple%20Windows%20editions%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EThe%20main%20OS%20(install.wim)%20contains%20multiple%20editions%20of%20Windows%2010.%20It%E2%80%99s%20possible%20that%20only%20a%20patch%20for%20the%20edition%20is%20required%20to%20deploy%2C%20based%20on%20the%20index.%20Or%2C%20if%20needed%2C%20loop%20through%20all%20editions%20and%20patch.%20Further%2C%20ensure%20that%20languages%20are%20installed%20before%20optional%20features%2C%20and%20the%20LCU%20is%20always%20applied%20last.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-233771674%22%20id%3D%22toc-hId-233771674%22%3ECustomizing%20Windows%20with%20additional%20languages%20and%20features%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EAlthough%20not%20required%20from%20a%20patching%20perspective%2C%20this%20is%20an%20opportunity%20to%20customize%20the%20image%20with%20languages%20and%20FODs.%20We%20highlight%20this%20to%20ensure%20the%20correct%20sequencing%20is%20used.%20Applying%20the%20patches%2C%20followed%20by%20language%20additions%2C%20then%20by%20FOD%20additions%2C%20and%20lastly%20finish%20with%20the%20LCU.%20In%20the%20script%20below%2C%20we%20will%20be%20installing%20a%20single%20language%2C%20in%20this%20case%20Japanese%20(ja-JP).%20Since%20this%20is%20a%20lp.cab%20backed%20language%2C%20there%20isn%E2%80%99t%20a%20need%20to%20add%20a%20Language%20Experience%20Pack%20(LXP).%20We%E2%80%99ll%20add%20Japanese%20to%20both%20the%20main%20OS%20and%20to%20the%20recovery%20environment%20to%20allow%20the%20user%20to%20see%20the%20recovery%20screens%20in%20Japanese.%20This%20includes%20adding%20localized%20versions%20of%20the%20packages%20currently%20installed%20in%20the%20recovery%20image.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-1976582009%22%20id%3D%22toc-hId-1976582009%22%3EUsing%20PowerShell%20to%20apply%20Dynamic%20Update%20content%20to%20an%20existing%20Windows%2010%20image%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIn%20this%20section%2C%20we%E2%80%99ll%20take%20the%20steps%20above%20and%20show%20how%20they%20can%20be%20executed%20using%20PowerShell.%20The%20code%20shown%20is%20for%20illustration%20purposes%20only%2C%20and%20thus%20lacks%20error%20handling.%20To%20get%20started%2C%20the%20PowerShell%20script%20assumes%20the%20following%20content%20is%20stored%20locally%20with%20the%20following%20folder%20structure%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%20style%3D%22background-color%3A%20%230078d4%3B%22%3E%0A%3CTD%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EFolder%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3E%3CFONT%20color%3D%22%23FFFFFF%22%3EDescription%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EC%3A%5CmediaRefresh%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EParent%20folder%20that%20contains%20the%20PowerShell%20script%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EC%3A%5CmediaRefresh%5ColdMedia%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EFolder%20that%20contains%20the%20original%20media%20that%20will%20be%20refreshed.%20For%20example%2C%20contains%20setup.exe%2C%20and%20%5Csources%20folder.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CP%3EC%3A%5CmediaRefresh%5CnewMedia%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%3E%3CP%3EFolder%20that%20will%20contain%20the%20patched%20media.%20It%20is%20copied%20from%20%5ColdMedia%2C%20then%20used%20as%20the%20target%20for%20all%20patching%20and%20cleanup%20operations.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--575574952%22%20id%3D%22toc-hId--575574952%22%3EGetting%20started%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EStart%20the%20script%20by%20declaring%20global%20variables%20and%20creating%20folders%20to%20use%20for%20mounting%20images.%20Then%2C%20make%20a%20copy%20of%20the%20original%20media%2C%20from%20%5ColdMedia%20to%20%5CnewMedia%2C%20keeping%20the%20original%20media%20in%20case%20there%20is%20a%20script%20error%20and%20thus%20we%20can%20start%20over%20from%20a%20known%20state.%20Also%2C%20it%20will%20provide%20a%20comparison%20of%20old%20versus%20new%20media%20to%20evaluate%20changes.%20To%20ensure%20the%20new%20media%20updates%2C%20ensure%20they%20are%20not%20read%20only.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Efunction%20Get-TS%20%7B%20return%20%22%7B0%3AHH%3Amm%3Ass%7D%22%20-f%20(Get-Date)%20%7D%20%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Starting%20media%20refresh%22%0A%0A%23%20Declare%20media%20for%20FOD%20and%20LPs%0A%24FOD_ISO_PATH%20%3D%20%22C%3A%5CmediaRefresh%5Cpackages%5CFOD-PACKAGES_OEM_PT1_amd64fre_MULTI.iso%22%0A%24LP_ISO_PATH%20%3D%20%22C%3A%5CmediaRefresh%5Cpackages%5CCLIENTLANGPACKDVD_OEM_MULTI.iso%22%0A%0A%23%20Declare%20language%20for%20showcasing%20adding%20optional%20localized%20components%0A%24LANG%20%3D%20%22ja-jp%22%0A%24LANG_FONT_CAPABILITY%20%3D%20%22jpan%22%0A%0A%23%20Declare%20Dynamic%20Update%20packages%0A%24LCU_PATH%20%3D%20%E2%80%9CC%3A%5CmediaRefresh%5Cpackages%5CLCU.msu%E2%80%9D%0A%24SSU_PATH%20%3D%20%E2%80%9CC%3A%5CmediaRefresh%5Cpackages%5CSSU_DU.msu%E2%80%9D%0A%24SETUP_DU_PATH%20%3D%20%22C%3A%5CmediaRefresh%5Cpackages%5CSetup_DU.cab%22%0A%24SAFE_OS_DU_PATH%20%3D%20%E2%80%9CC%3A%5CmediaRefresh%5Cpackages%5CSafeOS_DU.cab%E2%80%9D%0A%0A%23%20Declare%20folders%20for%20mounted%20images%20and%20temp%20files%0A%24WORKING_PATH%20%3D%20%22C%3A%5CmediaRefresh%5Ctemp%22%0A%24MEDIA_OLD_PATH%20%3D%20%22C%3A%5CmediaRefresh%5ColdMedia%22%0A%24MEDIA_NEW_PATH%20%3D%20%22C%3A%5CmediaRefresh%5CnewMedia%22%0A%24MAIN_OS_MOUNT%20%3D%20%24WORKING_PATH%20%2B%20%22%5CMainOSMount%E2%80%9D%0A%24WINRE_MOUNT%20%3D%20%24WORKING_PATH%20%2B%20%22%5CWinREMount%E2%80%9D%0A%24WINPE_MOUNT%20%3D%20%24WORKING_PATH%20%2B%20%22%5CWinPEMount%E2%80%9D%0A%0A%23%20Mount%20the%20LP%20ISO%0AWrite-Host%20%22%24(Get-TS)%3A%20Mounting%20LP%20ISO%22%0A%24LP_ISO_DRIVE_LETTER%20%3D%20(Mount-DiskImage%20-ImagePath%20%24LP_ISO_PATH%20-ErrorAction%20stop%20%7C%20Get-Volume).DriveLetter%0A%0A%23%20Declare%20language%20related%20cabs%0A%24WINPE_OC_PATH%20%3D%20Join-Path%20%24LP_ISO_DRIVE_LETTER%22%3A%22%20-ChildPath%20%22Windows%20Preinstallation%20Environment%22%20%7C%20Join-Path%20-ChildPath%20%22x64%22%20%7C%20Join-Path%20-ChildPath%20%22WinPE_OCs%22%0A%24WINPE_OC_LANG_PATH%20%3D%20Join-Path%20%24WINPE_OC_PATH%20%24LANG%0A%24WINPE_OC_LANG_CABS%20%3D%20Get-ChildItem%20%24WINPE_OC_LANG_PATH%20-name%0A%24WINPE_OC_LP_PATH%20%3D%20Join-Path%20%24WINPE_OC_LANG_PATH%20%22lp.cab%22%0A%24WINPE_FONT_SUPPORT_PATH%20%3D%20Join-Path%20%24WINPE_OC_PATH%20%22WinPE-FontSupport-%24LANG.cab%22%0A%24WINPE_SPEECH_TTS_PATH%20%3D%20Join-Path%20%24WINPE_OC_PATH%20%22WinPE-Speech-TTS.cab%22%0A%24WINPE_SPEECH_TTS_LANG_PATH%20%3D%20Join-Path%20%24WINPE_OC_PATH%20%22WinPE-Speech-TTS-%24LANG.cab%22%0A%24OS_LP_PATH%20%3D%20%24LP_ISO_DRIVE_LETTER%20%2B%20%22%3A%5Cx64%5Clangpacks%5C%22%20%2B%20%22Microsoft-Windows-Client-Language-Pack_x64_%22%20%2B%20%24LANG%20%2B%20%22.cab%22%0A%0A%23%20Mount%20the%20FOD%20ISO%0AWrite-Host%20%22%24(Get-TS)%3A%20Mounting%20FOD%20ISO%22%0A%24FOD_ISO_DRIVE_LETTER%20%3D%20(Mount-DiskImage%20-ImagePath%20%24FOD_ISO_PATH%20-ErrorAction%20stop%20%7C%20Get-Volume).DriveLetter%0A%24FOD_PATH%20%3D%20%24FOD_ISO_DRIVE_LETTER%20%2B%20%22%3A%5C%22%20%0A%0A%23%20Create%20folders%20for%20mounting%20images%20and%20storing%20temporary%20files%0ANew-Item%20-ItemType%20directory%20-Path%20%24WORKING_PATH%20-ErrorAction%20Stop%20%7C%20Out-Null%0ANew-Item%20-ItemType%20directory%20-Path%20%24MAIN_OS_MOUNT%20-ErrorAction%20stop%20%7C%20Out-Null%0ANew-Item%20-ItemType%20directory%20-Path%20%24WINRE_MOUNT%20-ErrorAction%20stop%20%7C%20Out-Null%0ANew-Item%20-ItemType%20directory%20-Path%20%24WINPE_MOUNT%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Keep%20the%20original%20media%2C%20make%20a%20copy%20of%20it%20for%20the%20new%2C%20patched%20media.%0AWrite-Host%20%22%24(Get-TS)%3A%20Copying%20original%20media%20to%20new%20media%20path%22%0ACopy-Item%20-Path%20%24MEDIA_OLD_PATH%E2%80%9C%5C*%E2%80%9D%20-Destination%20%24MEDIA_NEW_PATH%20-Force%20-Recurse%20-ErrorAction%20stop%20%7C%20Out-Null%0AGet-ChildItem%20-Path%20%24MEDIA_NEW_PATH%20-Recurse%20%7C%20Where-Object%20%7B%20-not%20%24_.PSIsContainer%20-and%20%24_.IsReadOnly%20%7D%20%7C%20ForEach-Object%20%7B%20%24_.IsReadOnly%20%3D%20%24false%20%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-1167235383%22%20id%3D%22toc-hId-1167235383%22%3EPatch%20WinRE%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EStart%20by%20assuming%20we%E2%80%99re%20only%20patching%20a%20single%20edition%2C%20indicated%20by%20Index%20%3D%201%20(Windows%2010%20Education%20Edition).%20Then%2C%20mount%20the%20image%2C%20save%20winre.wim%20to%20the%20working%20folder%2C%20and%20mount%20it.%20To%20get%20started%2C%20apply%20SSU%20DU%2C%20given%20its%20components%20are%20used%20for%20updating%20other%20components.%20Since%20we%20are%20optionally%20adding%20Japanese%2C%20add%20the%20language%20pack%20to%20the%20image%2C%20and%20install%20the%20Japanese%20versions%20of%20all%20optional%20components%20%3CEM%3Ealready%20installed%3C%2FEM%3E%20in%20winre.wim.%20Then%2C%20apply%20the%20Safe%20OS%20DU%20package.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ETo%20finish%2C%20clean%20and%20export%20the%20image%20to%20reduce%20the%20image%20size.%20%3CSTRONG%3ENote%3A%20%3C%2FSTRONG%3ESkip%20adding%20the%20LCU%20to%20winre.wim%20because%20it%20contains%20unnecessary%20components%20in%20the%20recovery%20environment.%20The%20components%20that%20are%20updated%20and%20applicable%20are%20contained%20within%20the%20Safe%20OS%20DU%20package.%20This%20also%20helps%20to%20keep%20the%20image%20small.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23%20Mount%20the%20main%20OS%2C%20I'll%20use%20this%20throughout%20the%20script%0AWrite-Host%20%22%24(Get-TS)%3A%20Mounting%20main%20OS%22%0AMount-WindowsImage%20-ImagePath%20%24MEDIA_NEW_PATH%22%5Csources%5Cinstall.wim%E2%80%9D%20-Index%201%20-Path%20%24MAIN_OS_MOUNT%20-ErrorAction%20stop%7C%20Out-Null%20%20%0A%0A%23%0A%23%20Patch%20Windows%20Recovery%20Environment%20(WinRE)%0A%23%0ACopy-Item%20-Path%20%24MAIN_OS_MOUNT%22%5Cwindows%5Csystem32%5Crecovery%5Cwinre.wim%E2%80%9D%20-Destination%20%24WORKING_PATH%22%5Cwinre.wim%E2%80%9D%20-Force%20-Recurse%20-ErrorAction%20stop%20%7C%20Out-Null%0AWrite-Host%20%22%24(Get-TS)%3A%20Mounting%20WinRE%22%0AMount-WindowsImage%20-ImagePath%20%24WORKING_PATH%22%5Cwinre.wim%E2%80%9D%20-Index%201%20-Path%20%24WINRE_MOUNT%20-ErrorAction%20stop%20%7C%20Out-Null%20%0A%0A%23%20Add%20SSU%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24SSU_PATH%22%0AAdd-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24SSU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%23%0A%23%20Optional%3A%20Add%20the%20language%20to%20recovery%20environment%0A%23%0A%23%20Install%20lp.cab%20cab%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_OC_LP_PATH%22%0AAdd-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24WINPE_OC_LP_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%23%20Install%20language%20cabs%20for%20each%20optional%20component%20package%20installed%0A%24WINRE_INSTALLED_OC%20%3D%20Get-WindowsPackage%20-Path%20%24WINRE_MOUNT%0AForeach%20(%24PACKAGE%20in%20%24WINRE_INSTALLED_OC)%20%7B%0A%0A%20%20%20%20if%20(%20(%24PACKAGE.PackageState%20-eq%20%22Installed%22)%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20-and%20(%24PACKAGE.PackageName.startsWith(%22WinPE-%22))%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20-and%20(%24PACKAGE.ReleaseType%20-eq%20%22FeaturePack%22)%20)%20%7B%0A%0A%20%20%20%20%20%20%20%20%24INDEX%20%3D%20%24PACKAGE.PackageName.IndexOf(%22-Package%22)%0A%20%20%20%20%20%20%20%20if%20(%24INDEX%20-ge%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24OC_CAB%20%3D%20%24PACKAGE.PackageName.Substring(0%2C%20%24INDEX)%20%2B%20%22_%22%20%2B%20%24LANG%20%2B%20%22.cab%22%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24WINPE_OC_LANG_CABS.Contains(%24OC_CAB))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24OC_CAB_PATH%20%3D%20Join-Path%20%24WINPE_OC_LANG_PATH%20%24OC_CAB%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24OC_CAB_PATH%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24OC_CAB_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%0A%23%20Add%20font%20support%20for%20the%20new%20language%0Aif%20(%20(Test-Path%20-Path%20%24WINPE_FONT_SUPPORT_PATH)%20)%20%7B%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_FONT_SUPPORT_PATH%22%0A%20%20%20%20Add-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24WINPE_FONT_SUPPORT_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%7D%0A%0A%23%20Add%20TTS%20support%20for%20the%20new%20language%0Aif%20(Test-Path%20-Path%20%24WINPE_SPEECH_TTS_PATH)%20%7B%0A%20%20%20%20if%20(%20(Test-Path%20-Path%20%24WINPE_SPEECH_TTS_LANG_PATH)%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_SPEECH_TTS_PATH%22%0A%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24WINPE_SPEECH_TTS_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_SPEECH_TTS_LANG_PATH%22%0A%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24WINPE_SPEECH_TTS_LANG_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%7D%0A%7D%0A%0A%23%20Add%20Safe%20OS%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24SAFE_OS_DU_PATH%22%0AAdd-WindowsPackage%20-Path%20%24WINRE_MOUNT%20-PackagePath%20%24SAFE_OS_DU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%20%0A%0A%23%20Perform%20image%20cleanup%0AWrite-Host%20%22%24(Get-TS)%3A%20Performing%20image%20cleanup%20on%20WinRE%22%0ADISM%20%2Fimage%3A%24WINRE_MOUNT%20%2Fcleanup-image%20%2FStartComponentCleanup%20%7C%20Out-Null%0A%0A%23%20Dismount%0ADismount-WindowsImage%20-Path%20%24WINRE_MOUNT%20%20-Save%20-ErrorAction%20stop%20%7C%20Out-Null%20%0A%0A%23%20Export%0AWrite-Host%20%22%24(Get-TS)%3A%20Exporting%20image%20to%20%24WORKING_PATH%5Cwinre2.wim%E2%80%9D%0AExport-WindowsImage%20-SourceImagePath%20%24WORKING_PATH%22%5Cwinre.wim%E2%80%9D%20-SourceIndex%201%20-DestinationImagePath%20%24WORKING_PATH%22%5Cwinre2.wim%E2%80%9D%20-ErrorAction%20stop%20%7C%20Out-Null%0AMove-Item%20-Path%20%24WORKING_PATH%22%5Cwinre2.wim%E2%80%9D%20-Destination%20%24WORKING_PATH%22%5Cwinre.wim%E2%80%9D%20-Force%20-ErrorAction%20stop%20%7C%20Out-Null%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--1384921578%22%20id%3D%22toc-hId--1384921578%22%3EPatch%20WinPE%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFollowing%20a%20similar%20pattern%20as%20above%2C%20but%20this%20time%20mount%20boot.wim%2C%20apply%20the%20packages%20with%20LCU%20going%20last%2C%20and%20save.%20This%20is%20done%20for%20all%20images%20inside%20of%20boot.wim%2C%20typically%20two%20images.%20Again%2C%20start%20by%20applying%20the%20SSU%20Dynamic%20Update.%20Since%20we%20are%20customizing%20this%20media%20with%20Japanese%2C%20again%20install%20the%20language%20pack%20from%20the%20WinPE%20folder%20on%20the%20language%20pack%20ISO.%20Additionally%2C%20add%20font%20support%20and%20text%20to%20speak%20(TTS)%20support.%20Since%20we%20are%20adding%20a%20new%20language%2C%20rebuild%20lang.ini%2C%20used%20to%20identify%20languages%20installed%20in%20the%20image.%20Finally%2C%20clean%20and%20export%20boot.wim%2C%20and%20copy%20back%20to%20the%20new%20media.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23%20%0A%23%20Patch%20Windows%20Preinstallation%20Environment%20(WinPE)%0A%23%20%0A%0A%23%20Get%20the%20list%20of%20images%20contained%20within%20WinPE%0A%24WINPE_IMAGES%20%3D%20Get-WindowsImage%20-ImagePath%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cboot.wim%E2%80%9D%0A%0AForeach%20(%24IMAGE%20in%20%24WINPE_IMAGES)%20%7B%0A%0A%20%20%20%20%23%20Patch%20WinPE%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Mounting%20WinPE%22%0A%20%20%20%20Mount-WindowsImage%20-ImagePath%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cboot.wim%E2%80%9D%20-Index%20%24IMAGE.ImageIndex%20-Path%20%24WINPE_MOUNT%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%20%20%20%20%23%20Add%20SSU%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24SSU_PATH%22%0A%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24SSU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%23%20Install%20lp.cab%20cab%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_OC_LP_PATH%22%0A%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24WINPE_OC_LP_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%20%20%20%20%23%20Install%20language%20cabs%20for%20each%20optional%20component%20package%20installed%0A%20%20%20%20%24WINPE_INSTALLED_OC%20%3D%20Get-WindowsPackage%20-Path%20%24WINPE_MOUNT%0A%20%20%20%20Foreach%20(%24PACKAGE%20in%20%24WINPE_INSTALLED_OC)%20%7B%0A%0A%20%20%20%20%20%20%20%20if%20(%20(%24PACKAGE.PackageState%20-eq%20%22Installed%22)%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-and%20(%24PACKAGE.PackageName.startsWith(%22WinPE-%22))%20%60%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-and%20(%24PACKAGE.ReleaseType%20-eq%20%22FeaturePack%22)%20)%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%24INDEX%20%3D%20%24PACKAGE.PackageName.IndexOf(%22-Package%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24INDEX%20-ge%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24OC_CAB%20%3D%20%24PACKAGE.PackageName.Substring(0%2C%20%24INDEX)%20%2B%20%22_%22%20%2B%20%24LANG%20%2B%20%22.cab%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(%24WINPE_OC_LANG_CABS.Contains(%24OC_CAB))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24OC_CAB_PATH%20%3D%20Join-Path%20%24WINPE_OC_LANG_PATH%20%24OC_CAB%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24OC_CAB_PATH%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24OC_CAB_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%23%20Add%20font%20support%20for%20the%20new%20language%0A%20%20%20%20if%20(%20(Test-Path%20-Path%20%24WINPE_FONT_SUPPORT_PATH)%20)%20%7B%0A%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_FONT_SUPPORT_PATH%22%0A%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24WINPE_FONT_SUPPORT_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%7D%0A%0A%20%20%20%20%23%20Add%20TTS%20support%20for%20the%20new%20language%0A%20%20%20%20if%20(Test-Path%20-Path%20%24WINPE_SPEECH_TTS_PATH)%20%7B%0A%20%20%20%20%20%20%20%20if%20(%20(Test-Path%20-Path%20%24WINPE_SPEECH_TTS_LANG_PATH)%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_SPEECH_TTS_PATH%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24WINPE_SPEECH_TTS_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24WINPE_SPEECH_TTS_LANG_PATH%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24WINPE_SPEECH_TTS_LANG_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%23%20Generates%20a%20new%20Lang.ini%20file%20which%20is%20used%20to%20define%20the%20language%20packs%20inside%20the%20image%0A%20%20%20%20if%20(%20(Test-Path%20-Path%20%24WINPE_MOUNT%22%5Csources%5Clang.ini%22)%20)%20%7B%0A%20%20%20%20%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Updating%20lang.ini%22%0A%20%20%20%20%20%20%20%20DISM%20%2Fimage%3A%24WINPE_MOUNT%20%2FGen-LangINI%20%2Fdistribution%3A%24WINPE_MOUNT%20%7C%20Out-Null%0A%20%20%20%20%7D%20%20%20%20%0A%20%20%20%20%0A%20%20%20%20%23%20Add%20LCU%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24LCU_PATH%22%0A%20%20%20%20Add-WindowsPackage%20-Path%20%24WINPE_MOUNT%20-PackagePath%20%24LCU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%20%20%20%20%23%20Perform%20image%20cleanup%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Performing%20image%20cleanup%20on%20WinPE%22%0A%20%20%20%20DISM%20%2Fimage%3A%24WINPE_MOUNT%20%2Fcleanup-image%20%2FStartComponentCleanup%20%7C%20Out-Null%0A%0A%20%20%20%20%23%20Dismount%0A%20%20%20%20Dismount-WindowsImage%20-Path%20%24WINPE_MOUNT%20-Save%20-ErrorAction%20stop%20%7C%20Out-Null%20%0A%0A%20%20%20%20%23Export%20WinPE%0A%20%20%20%20Write-Host%20%22%24(Get-TS)%3A%20Exporting%20image%20to%20%24WORKING_PATH%5Cboot2.wim%E2%80%9D%0A%20%20%20%20Export-WindowsImage%20-SourceImagePath%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cboot.wim%E2%80%9D%20-SourceIndex%20%24IMAGE.ImageIndex%20-DestinationImagePath%20%24WORKING_PATH%22%5Cboot2.wim%22%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%7D%0A%0AMove-Item%20-Path%20%24WORKING_PATH%22%5Cboot2.wim%22%20-Destination%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cboot.wim%E2%80%9D%20-Force%20-ErrorAction%20stop%20%7C%20Out-Null%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-357888757%22%20id%3D%22toc-hId-357888757%22%3EPatch%20the%20main%20OS%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EWhen%20moving%20on%20to%20the%20main%20OS%2C%20note%20that%20it%20is%20already%20mounted%20from%20above.%20again%20start%20by%20applying%20SSU%20Dynamic%20Update.%20Then%2C%20add%20in%20Japanese%20language%20support.%20Next%2C%20Iadd%20the%20Japanese%20language%20FOD.%20Unlike%20the%20DU%20packages%2C%20leverage%20%3CFONT%20color%3D%22%230000FF%22%3EAdd-WindowsCapability%3C%2FFONT%3E%20to%20add%20FODs.%20For%20a%20full%20list%20of%20FODs%2C%20and%20their%20associated%20capability%20name%2C%20see%20Available%20Features%20on%20Demand.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ENow%20is%20the%20time%20to%20add%20enable%20other%20optional%20components%20or%20add%20other%20FODs.%20Further%2C%20if%20the%20FOD%20has%20an%20associated%20cumulative%20update%20(e.g.%20.Net)%2C%20apply%20these%20now.%20Proceed%20with%20applying%20the%20LCU.%20As%20a%20rule%2C%20this%20always%20get%20applied%20last.%20Finally%2C%20clean%20and%20export%20the%20image.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23%20%0A%23%20Patch%20Main%20OS%0A%23%20%0A%0A%23%20Add%20SSU%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24SSU_PATH%22%0AAdd-WindowsPackage%20-Path%20%24MAIN_OS_MOUNT%20-PackagePath%20%24SSU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Optional%3A%20Add%20language%20to%20main%20OS%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24OS_LP_PATH%22%0AAdd-WindowsPackage%20-Path%20%24MAIN_OS_MOUNT%20-PackagePath%20%24OS_LP_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%20%0A%0A%23%20Optional%3A%20Add%20a%20FODs%20to%20the%20image%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3A%20Language.Fonts.Jpan~~~und-JPAN~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.Fonts.%24LANG_FONT_CAPABILITY~~~und-%24LANG_FONT_CAPABILITY~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3A%20Language.Basic~~~%24LANG~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.Basic~~~%24LANG~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3A%20Language.OCR~~~%24LANG~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.OCR~~~%24LANG~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3A%20Language.Handwriting~~~%24LANG~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.Handwriting~~~%24LANG~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3A%20Language.TextToSpeech~~~%24LANG~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.TextToSpeech~~~%24LANG~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20language%20FOD%3ALanguage.Speech~~~%24LANG~0.0.1.0%22%0AAdd-WindowsCapability%20-Name%20%22Language.Speech~~~%24LANG~0.0.1.0%22%20-Path%20%24MAIN_OS_MOUNT%20-Source%20%24FOD_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Note%3A%20If%20I%20wanted%20to%20enable%20additional%20optional%20components%2C%20I'd%20add%20these%20here.%20For%20example%2C%20.Net%203.5%0A%23%20Note%3A%20If%20I%20have%20updates%20for%20optional%20components%2C%20I'd%20add%20these%20here.%20For%20example%2C%20Cumulative%20Update%20for%20.Net%203.5%0A%0A%23%20Add%20LCU%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24LCU_PATH%22%0AAdd-WindowsPackage%20-Path%20%24MAIN_OS_MOUNT%20-PackagePath%20%24LCU_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%0A%0A%23%20Copy%20our%20updated%20recovery%20image%20from%20earlier%20into%20the%20main%20OS%0A%23%20Note%3A%20If%20I%20were%20updating%20more%20than%201%20edition%2C%20I'd%20want%20to%20copy%20the%20same%20recovery%20image%20file%20%0A%23%20into%20each%20edition%20to%20enable%20single%20instancing%0ACopy-Item%20-Path%20%24WORKING_PATH%22%5Cwinre.wim%E2%80%9D%20-Destination%20%24MAIN_OS_MOUNT%22%5Cwindows%5Csystem32%5Crecovery%5Cwinre.wim%E2%80%9D%20-Force%20-Recurse%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Perform%20image%20cleanup%0AWrite-Host%20%22%24(Get-TS)%3A%20Performing%20image%20cleanup%20on%20main%20OS%22%0ADISM%20%2Fimage%3A%24MAIN_OS_MOUNT%20%2Fcleanup-image%20%2FStartComponentCleanup%20%7C%20Out-Null%0A%0A%23%20Dismount%0ADismount-WindowsImage%20-Path%20%24MAIN_OS_MOUNT%20-Save%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Export%0AWrite-Host%20%22%24(Get-TS)%3A%20Exporting%20image%20to%20%24WORKING_PATH%5Cinstall2.wim%E2%80%9D%0AExport-WindowsImage%20-SourceImagePath%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cinstall.wim%E2%80%9D%20-SourceIndex%201%20-DestinationImagePath%20%24WORKING_PATH%22%5Cinstall2.wim%E2%80%9D%20-ErrorAction%20stop%20%7C%20Out-Null%0AMove-Item%20-Path%20%24WORKING_PATH%22%5Cinstall2.wim%E2%80%9D%20-Destination%20%24MEDIA_NEW_PATH%E2%80%9C%5Csources%5Cinstall.wim%E2%80%9D%20-Force%20-ErrorAction%20stop%20%7C%20Out-Null%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--1308991639%22%20id%3D%22toc-hId--1308991639%22%3EPatch%20remaining%20media%20files%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ENext%2C%20update%20the%20setup%20files.%20This%20is%20a%20simple%20copy%20of%20the%20individual%20files%20in%20the%20Setup%20DU%20package%20to%20the%20new%20media.%20This%20step%20brings%20an%20updated%20setup.exe%20as%20needed%2C%20along%20with%20the%20latest%20compatibility%20database%2C%20and%20replacement%20component%20manifests.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23%0A%23%20Patch%20remaining%20files%20on%20media%0A%23%0A%0A%23%20Add%20Setup%20DU%20by%20copy%20the%20files%20from%20the%20package%20into%20the%20newMedia%0AWrite-Host%20%22%24(Get-TS)%3A%20Adding%20package%20%24SETUP_DU_PATH%22%0Acmd.exe%20%2Fc%20%24env%3ASystemRoot%5CSystem32%5Cexpand.exe%20%24SETUP_DU_PATH%20-F%3A*%20%24MEDIA_NEW_PATH%22%5Csources%22%20%7C%20Out-Null%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-433818696%22%20id%3D%22toc-hId-433818696%22%3EFinishing%20up!%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EAs%20a%20last%20step%2C%20we%E2%80%99ll%20remove%20our%20working%20folder%20of%20temporary%20files%2C%20and%20unmount%20our%20language%20pack%20and%20FOD%20ISOs.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%23%0A%23%20Perform%20final%20cleanup%0A%23%0A%0A%23%20Remove%20our%20working%20folder%0ARemove-Item%20-Path%20%24WORKING_PATH%20-Recurse%20-Force%20-ErrorAction%20stop%20%7C%20Out-Null%0A%0A%23%20Dismount%20ISO%20images%0AWrite-Host%20%22%24(Get-TS)%3A%20Dismounting%20ISO%20images%22%0ADismount-DiskImage%20-ImagePath%20%24LP_ISO_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%0ADismount-DiskImage%20-ImagePath%20%24FOD_ISO_PATH%20-ErrorAction%20stop%20%7C%20Out-Null%20%0A%0AWrite-Host%20%22%24(Get-TS)%3A%20Media%20refresh%20completed!%22%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--2118338265%22%20id%3D%22toc-hId--2118338265%22%3ELearn%20more%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%20margin-top%3A%2020px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWindows-IT-Pro-Blog%2FThe-benefits-of-Windows-10-Dynamic-Update%2Fba-p%2F467847%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EThe%20Benefits%20of%20Windows%2010%20Dynamic%20Update%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fwindows-hardware%2Fmanufacture%2Fdesktop%2Fdism---deployment-image-servicing-and-management-technical-reference-for-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDISM%20-%20Deployment%20Image%20Servicing%20and%20Management%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fwindows-hardware%2Fmanufacture%2Fdesktop%2Fadd-language-packs-to-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAdd%20languages%20to%20Windows%20images%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-982477%22%20slang%3D%22en-US%22%3E%3CP%3EGet%20a%20step-by-step%20guide%20to%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3Eacquiring%20and%20applying%20Dynamic%20Update%20packages.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-982477%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EServicing%20and%20updates%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

In the recent blog entitled The benefits of Windows 10 Dynamic Update, Monika Sinha provided an overview of Dynamic Update, the benefits of enabling it, how it works, and how to manage this content in a managed environment.

For IT pros that want to have these updates applied to their Windows 10 image prior to deployment, they need to understand how Dynamic Update packages can be acquired and applied to their image. This blog will walk through the steps for acquiring and applying Dynamic Update packages, showcasing a sample PowerShell script.

Dynamic Update refresher

As soon as a Windows 10 feature update initiates, whether from media or a Windows Update service-connected environment, Dynamic Update is one of the first steps invoked. Windows 10 Setup reaches out to an Internet-facing URL hosted by Microsoft to fetch Dynamic Update content, then applies those updates to your OS installation media.

Content acquired includes:

  • Setup Updates: Fixes to Setup binaries or any files that Setup uses for feature updates.
  • Safe OS Updates: Fixes for the "safe OS" that are used to update Windows recovery environment (WinRE).
  • Servicing Stack Updates: Fixes that are necessary to address the Windows 10 servicing stack issue and thus required to complete the feature update.
  • Latest Cumulative Update: Installs the latest cumulative quality update.
  • Driver Updates: Latest version of applicable drivers that have already been published by manufacturers into Windows Update and specifically targeted for Dynamic Update.

In addition to these updates, Dynamic Update will preserve Language Pack (LP) and Features on Demand (FODs) content during the upgrade process. These are not updates to LPs and FODs, but reacquisition to ensure the user has these elements present with the update completes.

For some environments, enabling acquired Dynamic Update content and installing that content on the device is not an option. For example, the device may not have internet connectivity. If one is performing a media-based feature update, most Dynamic Update content can be acquired and applied to the image before initiating setup on the device.

Let's briefly walk through the high-level steps. Then, we'll look at how to perform these steps using a PowerShell script.

Acquiring the content

Visit the Microsoft Update Catalog and acquire the Dynamic Update cumulative content packages used to apply to the image. At the main search bar, searching for ""1809 Dynamic Update" will show a listing as follows:

update-catalog.png

It appears that there is a Safe OS Dynamic Update available to download. However, what about the other packages? To understand how to map these search results requires closer inspection of each Title, Product and Description.

The below table shows you how to differentiate each type of Dynamic Update package:

DU Content

Title

Product

Description

SafeOS DU

2019-08 Dynamic Update...

Windows 10 Dynamic Update,Windows Safe OS Dynamic Update

ComponentUpdate:

Setup DU

2019-08 Dynamic Update...

Windows 10 Dynamic Update

SetupUpdate:

LCU

2019-08 Cumulative Update for Windows 10

Windows 10

Install this update to resolve issues in Windows...

SSU DU

2019-09 Servicing Stack Update for Windows 10

Windows 10...

Install this update to resolve issues in Windows...

In order to customize the OS image with additional languages or FODs, have the OS supplemental media ISOs available, which are downloadable from the Microsoft Volume Licensing Service Center. For example, since Dynamic Update will be disabled for your devices, and should users require specific FODs, these can be preinstalled into the image.

Patching the Windows 10 installation media

Now we can work on how the packages and acquired supplemental media can be used to patch Windows 10 OS media. To get started, let’s look at the high-level steps we’ll perform using PowerShell.

The table below shows the steps (as rows) that are executed against a target (as columns). Many of these tasks are repeated for target. For example, tasks that are repeated for each of the multiple Windows image files, such as applying SSU DU, cleaning the image, and exporting the image. The targets of these actions are as follows:

  • WinPE: The Windows Preinstallation Environment (WinPE) is a small operating system used to install, deploy, and repair Windows 10 desktop editions, Windows Server, and other Windows operating systems. From WinPE, it’s possible to set up a hard drive before installing Windows, install Windows by using apps or scripts from a network or a local drive, or capture and apply Windows images. Further, it’s possible to modify the Windows operating system while it's not running, set up automatic recovery tools, recover data from unbootable devices, and add a custom shell or GUI to automate tasks.
  • WinRE: The Windows Recovery Environment (WinRE) repair common causes of unbootable operating systems. WinRE is based on Windows Preinstallation Environment and can be customized with additional drivers, languages, Windows PE Optional Components, and other troubleshooting or diagnostic tools.
  • Main OS: The main OS is one or more Windows 10 editions stored within \sources\install.wim.
  • Media: Media in the table below represents the complete collection of files and folders in the Windows 10 installation media. For example, \sources folder, \boot folder, setup.exe, etc.

     

    WinRE (winre.wim)

    WinPE (boot.wim)

    Main OS (install.wim)

    New media

    Add SSU DU

    1

    9

    18

     

    Add Lang Pack

    2

    10

    19

     

    Add Localized Optional Components

    3

    11

       

    Add Font Support

    4

    12

       

    Add TTS Support

    5

    13

       

    Update Lang.ini

     

    14

       

    Add FOD

       

    20

     

    Add .Net Cumulative Updates

       

    21

     

    Add Safe OS DU

    6

         

    Add Setup DU

         

    25

    Add LCU

     

    15

    22

     

    Clean Image

    7

    16

    23

     

    Export Image

    8

    17

    24

     

Handling multiple Windows editions

The main OS (install.wim) contains multiple editions of Windows 10. It’s possible that only a patch for the edition is required to deploy, based on the index. Or, if needed, loop through all editions and patch. Further, ensure that languages are installed before optional features, and the LCU is always applied last.

Customizing Windows with additional languages and features

Although not required from a patching perspective, this is an opportunity to customize the image with languages and FODs. We highlight this to ensure the correct sequencing is used. Applying the patches, followed by language additions, then by FOD additions, and lastly finish with the LCU. In the script below, we will be installing a single language, in this case Japanese (ja-JP). Since this is a lp.cab backed language, there isn’t a need to add a Language Experience Pack (LXP). We’ll add Japanese to both the main OS and to the recovery environment to allow the user to see the recovery screens in Japanese. This includes adding localized versions of the packages currently installed in the recovery image.

Using PowerShell to apply Dynamic Update content to an existing Windows 10 image

In this section, we’ll take the steps above and show how they can be executed using PowerShell. The code shown is for illustration purposes only, and thus lacks error handling. To get started, the PowerShell script assumes the following content is stored locally with the following folder structure:

Folder

Description

C:\mediaRefresh

Parent folder that contains the PowerShell script

C:\mediaRefresh\oldMedia

Folder that contains the original media that will be refreshed. For example, contains setup.exe, and \sources folder.

C:\mediaRefresh\newMedia

Folder that will contain the patched media. It is copied from \oldMedia, then used as the target for all patching and cleanup operations.

Getting started

Start the script by declaring global variables and creating folders to use for mounting images. Then, make a copy of the original media, from \oldMedia to \newMedia, keeping the original media in case there is a script error and thus we can start over from a known state. Also, it will provide a comparison of old versus new media to evaluate changes. To ensure the new media updates, ensure they are not read only.

 

function Get-TS { return "{0:HH:mm:ss}" -f (Get-Date) } 

Write-Host "$(Get-TS): Starting media refresh"

# Declare media for FOD and LPs
$FOD_ISO_PATH = "C:\mediaRefresh\packages\FOD-PACKAGES_OEM_PT1_amd64fre_MULTI.iso"
$LP_ISO_PATH = "C:\mediaRefresh\packages\CLIENTLANGPACKDVD_OEM_MULTI.iso"

# Declare language for showcasing adding optional localized components
$LANG = "ja-jp"
$LANG_FONT_CAPABILITY = "jpan"

# Declare Dynamic Update packages
$LCU_PATH = “C:\mediaRefresh\packages\LCU.msu”
$SSU_PATH = “C:\mediaRefresh\packages\SSU_DU.msu”
$SETUP_DU_PATH = "C:\mediaRefresh\packages\Setup_DU.cab"
$SAFE_OS_DU_PATH = “C:\mediaRefresh\packages\SafeOS_DU.cab”

# Declare folders for mounted images and temp files
$WORKING_PATH = "C:\mediaRefresh\temp"
$MEDIA_OLD_PATH = "C:\mediaRefresh\oldMedia"
$MEDIA_NEW_PATH = "C:\mediaRefresh\newMedia"
$MAIN_OS_MOUNT = $WORKING_PATH + "\MainOSMount”
$WINRE_MOUNT = $WORKING_PATH + "\WinREMount”
$WINPE_MOUNT = $WORKING_PATH + "\WinPEMount”

# Mount the LP ISO
Write-Host "$(Get-TS): Mounting LP ISO"
$LP_ISO_DRIVE_LETTER = (Mount-DiskImage -ImagePath $LP_ISO_PATH -ErrorAction stop | Get-Volume).DriveLetter

# Declare language related cabs
$WINPE_OC_PATH = Join-Path $LP_ISO_DRIVE_LETTER":" -ChildPath "Windows Preinstallation Environment" | Join-Path -ChildPath "x64" | Join-Path -ChildPath "WinPE_OCs"
$WINPE_OC_LANG_PATH = Join-Path $WINPE_OC_PATH $LANG
$WINPE_OC_LANG_CABS = Get-ChildItem $WINPE_OC_LANG_PATH -name
$WINPE_OC_LP_PATH = Join-Path $WINPE_OC_LANG_PATH "lp.cab"
$WINPE_FONT_SUPPORT_PATH = Join-Path $WINPE_OC_PATH "WinPE-FontSupport-$LANG.cab"
$WINPE_SPEECH_TTS_PATH = Join-Path $WINPE_OC_PATH "WinPE-Speech-TTS.cab"
$WINPE_SPEECH_TTS_LANG_PATH = Join-Path $WINPE_OC_PATH "WinPE-Speech-TTS-$LANG.cab"
$OS_LP_PATH = $LP_ISO_DRIVE_LETTER + ":\x64\langpacks\" + "Microsoft-Windows-Client-Language-Pack_x64_" + $LANG + ".cab"

# Mount the FOD ISO
Write-Host "$(Get-TS): Mounting FOD ISO"
$FOD_ISO_DRIVE_LETTER = (Mount-DiskImage -ImagePath $FOD_ISO_PATH -ErrorAction stop | Get-Volume).DriveLetter
$FOD_PATH = $FOD_ISO_DRIVE_LETTER + ":\" 

# Create folders for mounting images and storing temporary files
New-Item -ItemType directory -Path $WORKING_PATH -ErrorAction Stop | Out-Null
New-Item -ItemType directory -Path $MAIN_OS_MOUNT -ErrorAction stop | Out-Null
New-Item -ItemType directory -Path $WINRE_MOUNT -ErrorAction stop | Out-Null
New-Item -ItemType directory -Path $WINPE_MOUNT -ErrorAction stop | Out-Null

# Keep the original media, make a copy of it for the new, patched media.
Write-Host "$(Get-TS): Copying original media to new media path"
Copy-Item -Path $MEDIA_OLD_PATH“\*” -Destination $MEDIA_NEW_PATH -Force -Recurse -ErrorAction stop | Out-Null
Get-ChildItem -Path $MEDIA_NEW_PATH -Recurse | Where-Object { -not $_.PSIsContainer -and $_.IsReadOnly } | ForEach-Object { $_.IsReadOnly = $false }

 

Patch WinRE

Start by assuming we’re only patching a single edition, indicated by Index = 1 (Windows 10 Education Edition). Then, mount the image, save winre.wim to the working folder, and mount it. To get started, apply SSU DU, given its components are used for updating other components. Since we are optionally adding Japanese, add the language pack to the image, and install the Japanese versions of all optional components already installed in winre.wim. Then, apply the Safe OS DU package.

To finish, clean and export the image to reduce the image size. Note: Skip adding the LCU to winre.wim because it contains unnecessary components in the recovery environment. The components that are updated and applicable are contained within the Safe OS DU package. This also helps to keep the image small.

 

# Mount the main OS, I'll use this throughout the script
Write-Host "$(Get-TS): Mounting main OS"
Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH"\sources\install.wim” -Index 1 -Path $MAIN_OS_MOUNT -ErrorAction stop| Out-Null  

#
# Patch Windows Recovery Environment (WinRE)
#
Copy-Item -Path $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim” -Destination $WORKING_PATH"\winre.wim” -Force -Recurse -ErrorAction stop | Out-Null
Write-Host "$(Get-TS): Mounting WinRE"
Mount-WindowsImage -ImagePath $WORKING_PATH"\winre.wim” -Index 1 -Path $WINRE_MOUNT -ErrorAction stop | Out-Null 

# Add SSU
Write-Host "$(Get-TS): Adding package $SSU_PATH"
Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $SSU_PATH -ErrorAction stop | Out-Null  

#
# Optional: Add the language to recovery environment
#
# Install lp.cab cab
Write-Host "$(Get-TS): Adding package $WINPE_OC_LP_PATH"
Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $WINPE_OC_LP_PATH -ErrorAction stop | Out-Null  

# Install language cabs for each optional component package installed
$WINRE_INSTALLED_OC = Get-WindowsPackage -Path $WINRE_MOUNT
Foreach ($PACKAGE in $WINRE_INSTALLED_OC) {

    if ( ($PACKAGE.PackageState -eq "Installed") `
            -and ($PACKAGE.PackageName.startsWith("WinPE-")) `
            -and ($PACKAGE.ReleaseType -eq "FeaturePack") ) {

        $INDEX = $PACKAGE.PackageName.IndexOf("-Package")
        if ($INDEX -ge 0) {
            $OC_CAB = $PACKAGE.PackageName.Substring(0, $INDEX) + "_" + $LANG + ".cab"
            if ($WINPE_OC_LANG_CABS.Contains($OC_CAB)) {
                $OC_CAB_PATH = Join-Path $WINPE_OC_LANG_PATH $OC_CAB
                Write-Host "$(Get-TS): Adding package $OC_CAB_PATH"
                Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $OC_CAB_PATH -ErrorAction stop | Out-Null  
            }
        }
    }
}

# Add font support for the new language
if ( (Test-Path -Path $WINPE_FONT_SUPPORT_PATH) ) {
    Write-Host "$(Get-TS): Adding package $WINPE_FONT_SUPPORT_PATH"
    Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $WINPE_FONT_SUPPORT_PATH -ErrorAction stop | Out-Null
}

# Add TTS support for the new language
if (Test-Path -Path $WINPE_SPEECH_TTS_PATH) {
    if ( (Test-Path -Path $WINPE_SPEECH_TTS_LANG_PATH) ) {
            
        Write-Host "$(Get-TS): Adding package $WINPE_SPEECH_TTS_PATH"
        Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $WINPE_SPEECH_TTS_PATH -ErrorAction stop | Out-Null
            
        Write-Host "$(Get-TS): Adding package $WINPE_SPEECH_TTS_LANG_PATH"
        Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $WINPE_SPEECH_TTS_LANG_PATH -ErrorAction stop | Out-Null
    }
}

# Add Safe OS
Write-Host "$(Get-TS): Adding package $SAFE_OS_DU_PATH"
Add-WindowsPackage -Path $WINRE_MOUNT -PackagePath $SAFE_OS_DU_PATH -ErrorAction stop | Out-Null   

# Perform image cleanup
Write-Host "$(Get-TS): Performing image cleanup on WinRE"
DISM /image:$WINRE_MOUNT /cleanup-image /StartComponentCleanup | Out-Null

# Dismount
Dismount-WindowsImage -Path $WINRE_MOUNT  -Save -ErrorAction stop | Out-Null 

# Export
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\winre2.wim”
Export-WindowsImage -SourceImagePath $WORKING_PATH"\winre.wim” -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\winre2.wim” -ErrorAction stop | Out-Null
Move-Item -Path $WORKING_PATH"\winre2.wim” -Destination $WORKING_PATH"\winre.wim” -Force -ErrorAction stop | Out-Null

 

Patch WinPE

Following a similar pattern as above, but this time mount boot.wim, apply the packages with LCU going last, and save. This is done for all images inside of boot.wim, typically two images. Again, start by applying the SSU Dynamic Update. Since we are customizing this media with Japanese, again install the language pack from the WinPE folder on the language pack ISO. Additionally, add font support and text to speak (TTS) support. Since we are adding a new language, rebuild lang.ini, used to identify languages installed in the image. Finally, clean and export boot.wim, and copy back to the new media.

 

# 
# Patch Windows Preinstallation Environment (WinPE)
# 

# Get the list of images contained within WinPE
$WINPE_IMAGES = Get-WindowsImage -ImagePath $MEDIA_NEW_PATH“\sources\boot.wim”

Foreach ($IMAGE in $WINPE_IMAGES) {

    # Patch WinPE
    Write-Host "$(Get-TS): Mounting WinPE"
    Mount-WindowsImage -ImagePath $MEDIA_NEW_PATH“\sources\boot.wim” -Index $IMAGE.ImageIndex -Path $WINPE_MOUNT -ErrorAction stop | Out-Null  

    # Add SSU
    Write-Host "$(Get-TS): Adding package $SSU_PATH"
    Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $SSU_PATH -ErrorAction stop | Out-Null
        
    # Install lp.cab cab
    Write-Host "$(Get-TS): Adding package $WINPE_OC_LP_PATH"
    Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $WINPE_OC_LP_PATH -ErrorAction stop | Out-Null  

    # Install language cabs for each optional component package installed
    $WINPE_INSTALLED_OC = Get-WindowsPackage -Path $WINPE_MOUNT
    Foreach ($PACKAGE in $WINPE_INSTALLED_OC) {

        if ( ($PACKAGE.PackageState -eq "Installed") `
                -and ($PACKAGE.PackageName.startsWith("WinPE-")) `
                -and ($PACKAGE.ReleaseType -eq "FeaturePack") ) {

            $INDEX = $PACKAGE.PackageName.IndexOf("-Package")
            if ($INDEX -ge 0) {
                
                $OC_CAB = $PACKAGE.PackageName.Substring(0, $INDEX) + "_" + $LANG + ".cab"
                if ($WINPE_OC_LANG_CABS.Contains($OC_CAB)) {
                    $OC_CAB_PATH = Join-Path $WINPE_OC_LANG_PATH $OC_CAB
                    Write-Host "$(Get-TS): Adding package $OC_CAB_PATH"
                    Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $OC_CAB_PATH -ErrorAction stop | Out-Null  
                }
            }
        }
    }

    # Add font support for the new language
    if ( (Test-Path -Path $WINPE_FONT_SUPPORT_PATH) ) {
        Write-Host "$(Get-TS): Adding package $WINPE_FONT_SUPPORT_PATH"
        Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $WINPE_FONT_SUPPORT_PATH -ErrorAction stop | Out-Null
    }

    # Add TTS support for the new language
    if (Test-Path -Path $WINPE_SPEECH_TTS_PATH) {
        if ( (Test-Path -Path $WINPE_SPEECH_TTS_LANG_PATH) ) {
            
            Write-Host "$(Get-TS): Adding package $WINPE_SPEECH_TTS_PATH"
            Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $WINPE_SPEECH_TTS_PATH -ErrorAction stop | Out-Null
            
            Write-Host "$(Get-TS): Adding package $WINPE_SPEECH_TTS_LANG_PATH"
            Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $WINPE_SPEECH_TTS_LANG_PATH -ErrorAction stop | Out-Null
        }
    }

    # Generates a new Lang.ini file which is used to define the language packs inside the image
    if ( (Test-Path -Path $WINPE_MOUNT"\sources\lang.ini") ) {
        Write-Host "$(Get-TS): Updating lang.ini"
        DISM /image:$WINPE_MOUNT /Gen-LangINI /distribution:$WINPE_MOUNT | Out-Null
    }    
    
    # Add LCU
    Write-Host "$(Get-TS): Adding package $LCU_PATH"
    Add-WindowsPackage -Path $WINPE_MOUNT -PackagePath $LCU_PATH -ErrorAction stop | Out-Null  

    # Perform image cleanup
    Write-Host "$(Get-TS): Performing image cleanup on WinPE"
    DISM /image:$WINPE_MOUNT /cleanup-image /StartComponentCleanup | Out-Null

    # Dismount
    Dismount-WindowsImage -Path $WINPE_MOUNT -Save -ErrorAction stop | Out-Null 

    #Export WinPE
    Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\boot2.wim”
    Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH“\sources\boot.wim” -SourceIndex $IMAGE.ImageIndex -DestinationImagePath $WORKING_PATH"\boot2.wim" -ErrorAction stop | Out-Null

}

Move-Item -Path $WORKING_PATH"\boot2.wim" -Destination $MEDIA_NEW_PATH“\sources\boot.wim” -Force -ErrorAction stop | Out-Null

 

Patch the main OS

When moving on to the main OS, note that it is already mounted from above. again start by applying SSU Dynamic Update. Then, add in Japanese language support. Next, Iadd the Japanese language FOD. Unlike the DU packages, leverage Add-WindowsCapability to add FODs. For a full list of FODs, and their associated capability name, see Available Features on Demand.

Now is the time to add enable other optional components or add other FODs. Further, if the FOD has an associated cumulative update (e.g. .Net), apply these now. Proceed with applying the LCU. As a rule, this always get applied last. Finally, clean and export the image.

 

# 
# Patch Main OS
# 

# Add SSU
Write-Host "$(Get-TS): Adding package $SSU_PATH"
Add-WindowsPackage -Path $MAIN_OS_MOUNT -PackagePath $SSU_PATH -ErrorAction stop | Out-Null

# Optional: Add language to main OS
Write-Host "$(Get-TS): Adding package $OS_LP_PATH"
Add-WindowsPackage -Path $MAIN_OS_MOUNT -PackagePath $OS_LP_PATH -ErrorAction stop | Out-Null  

# Optional: Add a FODs to the image
Write-Host "$(Get-TS): Adding language FOD: Language.Fonts.Jpan~~~und-JPAN~0.0.1.0"
Add-WindowsCapability -Name "Language.Fonts.$LANG_FONT_CAPABILITY~~~und-$LANG_FONT_CAPABILITY~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

Write-Host "$(Get-TS): Adding language FOD: Language.Basic~~~$LANG~0.0.1.0"
Add-WindowsCapability -Name "Language.Basic~~~$LANG~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

Write-Host "$(Get-TS): Adding language FOD: Language.OCR~~~$LANG~0.0.1.0"
Add-WindowsCapability -Name "Language.OCR~~~$LANG~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

Write-Host "$(Get-TS): Adding language FOD: Language.Handwriting~~~$LANG~0.0.1.0"
Add-WindowsCapability -Name "Language.Handwriting~~~$LANG~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

Write-Host "$(Get-TS): Adding language FOD: Language.TextToSpeech~~~$LANG~0.0.1.0"
Add-WindowsCapability -Name "Language.TextToSpeech~~~$LANG~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

Write-Host "$(Get-TS): Adding language FOD:Language.Speech~~~$LANG~0.0.1.0"
Add-WindowsCapability -Name "Language.Speech~~~$LANG~0.0.1.0" -Path $MAIN_OS_MOUNT -Source $FOD_PATH -ErrorAction stop | Out-Null

# Note: If I wanted to enable additional optional components, I'd add these here. For example, .Net 3.5
# Note: If I have updates for optional components, I'd add these here. For example, Cumulative Update for .Net 3.5

# Add LCU
Write-Host "$(Get-TS): Adding package $LCU_PATH"
Add-WindowsPackage -Path $MAIN_OS_MOUNT -PackagePath $LCU_PATH -ErrorAction stop | Out-Null 

# Copy our updated recovery image from earlier into the main OS
# Note: If I were updating more than 1 edition, I'd want to copy the same recovery image file 
# into each edition to enable single instancing
Copy-Item -Path $WORKING_PATH"\winre.wim” -Destination $MAIN_OS_MOUNT"\windows\system32\recovery\winre.wim” -Force -Recurse -ErrorAction stop | Out-Null

# Perform image cleanup
Write-Host "$(Get-TS): Performing image cleanup on main OS"
DISM /image:$MAIN_OS_MOUNT /cleanup-image /StartComponentCleanup | Out-Null

# Dismount
Dismount-WindowsImage -Path $MAIN_OS_MOUNT -Save -ErrorAction stop | Out-Null

# Export
Write-Host "$(Get-TS): Exporting image to $WORKING_PATH\install2.wim”
Export-WindowsImage -SourceImagePath $MEDIA_NEW_PATH“\sources\install.wim” -SourceIndex 1 -DestinationImagePath $WORKING_PATH"\install2.wim” -ErrorAction stop | Out-Null
Move-Item -Path $WORKING_PATH"\install2.wim” -Destination $MEDIA_NEW_PATH“\sources\install.wim” -Force -ErrorAction stop | Out-Null

 

Patch remaining media files

Next, update the setup files. This is a simple copy of the individual files in the Setup DU package to the new media. This step brings an updated setup.exe as needed, along with the latest compatibility database, and replacement component manifests.

 

#
# Patch remaining files on media
#

# Add Setup DU by copy the files from the package into the newMedia
Write-Host "$(Get-TS): Adding package $SETUP_DU_PATH"
cmd.exe /c $env:SystemRoot\System32\expand.exe $SETUP_DU_PATH -F:* $MEDIA_NEW_PATH"\sources" | Out-Null 

 

Finishing up!

As a last step, we’ll remove our working folder of temporary files, and unmount our language pack and FOD ISOs.

 

#
# Perform final cleanup
#

# Remove our working folder
Remove-Item -Path $WORKING_PATH -Recurse -Force -ErrorAction stop | Out-Null

# Dismount ISO images
Write-Host "$(Get-TS): Dismounting ISO images"
Dismount-DiskImage -ImagePath $LP_ISO_PATH -ErrorAction stop | Out-Null
Dismount-DiskImage -ImagePath $FOD_ISO_PATH -ErrorAction stop | Out-Null 

Write-Host "$(Get-TS): Media refresh completed!" 

 

Learn more

2 Comments
Contributor

If you want easy mode version of this go get OSDBuilder from https://osdbuilder.osdeploy.com/ and it does all of the above and more in an automated fashion.

Occasional Contributor

Hello, Steve. I'm afraid this blog post is two years late. For one thing, dynamic updates have not been released for a year now. v1903 and v1909 do not have them. For another, we've developed our own in-house scripts by now. At least, you could have properly formatted your code either with syntax highlighting or with the HTML <code> tag.

By the way, your Get-TS function is unnecessary. Get-Date "HH:mm:ss" does the same thing.