I think the "Add-ContentADKWinPE" function is missing a few dependencies.
WinPE Optional Components (OC) Reference
Install WinPE-WMI before you install WinPE-NetFX
Install WinPE-WMI and WinPE-SecureStartup before you install WinPE-PlatformID
Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting before you install WinPE-PowerShell
Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-DismCmdlets.
Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-SecureBootCmdlets.
Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-StorageWMI.
Install WinPE-WMI before you install WinPE-SecureStartup.
Install WinPE-Setup before you install WinPE-Setup-Client.
Install WinPE-Setup before you install WinPE-Setup-Server.
So the function should use the following order adding the packages:
WinPE-WMI
WinPE-NetFX
WinPE-Scripting
WinPE-PowerShell
WinPE-SecureStartup
WinPE-Setup
I think the "Add-ContentADKWinPE" function is missing a few dependencies.
WinPE Optional Components (OC) Reference Install WinPE-WMI before you install WinPE-NetFX Install WinPE-WMI and WinPE-SecureStartup before you install WinPE-PlatformID Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting before you install WinPE-PowerShell Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-DismCmdlets. Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-SecureBootCmdlets. Install WinPE-WMI > WinPE-NetFX > WinPE-Scripting > WinPE-PowerShell before you install WinPE-StorageWMI. Install WinPE-WMI before you install WinPE-SecureStartup. Install WinPE-Setup before you install WinPE-Setup-Client. Install WinPE-Setup before you install WinPE-Setup-Server.
So the function should use the following order adding the packages: WinPE-WMI WinPE-NetFX WinPE-Scripting WinPE-PowerShell WinPE-SecureStartup WinPE-Setup