Removing default applications from win 10 1703 while creating a image

I am creating a custom win 10 1703, image in which i am removing all the default installed applications. But in that effort few applications which i want to keep are also getting uninstalled.one of them is IE, which is now comes as on demand feature. In order to keep IE and remove other applications i am using below script. But when i use “Browser.InternetExplorer~~~~0.0.11.0” as the name of the property, i get blue screen during image capture, however script works fine with IE name, i cant find any other property for IE which i can use in this script. Could you please help.

$WhiteListOnDemand = "NetFX3|Tools.Graphics.DirectX|Tools.DeveloperMode.Core|Language
Sengar Shimbesh 9:41 PM:

White list of Features On Demand V2 packages

Write-LogEntry -Value “Starting Features on Demand V2 removal”
$WhiteListOnDemand = @(
“NetFX3|Tools.Graphics.DirectX|Tools.DeveloperMode.Core|Language”,
“Browser.InternetExplorer~~~~0.0.11.0”
)

Get Features On Demand that should be removed

$OnDemandFeatures = Get-WindowsCapability -Online | Where-Object { $.Name -notmatch $WhiteListOnDemand -and $.State -like “Installed”} | Select-Object -ExpandProperty Name

foreach ($Feature in $OnDemandFeatures) {
try {
Write-LogEntry -Value “Removing feature on demand: $($Feature)”
Get-WindowsCapability -Online -ErrorAction Stop | Where-Object { $.Name -like $Feature } | Remove-WindowsCapability -Online -ErrorAction Stop
}
catch [System.Exception] {
Write-Warning -Message $
.Exception.Message
}
}

Are you removing the apps? I’ve always used remove-appprovisioning for Windows 10 default apps like people, maps, camera, Candy crush, ect… news

Thanks!! Jeff.

But we found a work around for this problem.