best response confirmed by RahamimL (Frequent Contributor)

@Rudy_Ooms_MVP thanks for your help.


My xml was wrong. I ended up creating a different app with a CMD file in it and the xml inside the win32 package. I also separated the PowerShell script to add the language to a different win32 package.


For anyone requiring something similar here is my xml:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>

<!-- GeoID -->
<gs:GeoID Value="117"/>

<gs:MUILanguage Value="en-US"/>
<gs:MUIFallback Value="he-IL"/>

<!-- system locale -->
<gs:SystemLocale Name="he-IL"/>

<!-- input preferences -->
<gs:InputLanguageID Action="add" ID="0409:00000409"/>
<gs:InputLanguageID Action="add" ID="040D:0002040D"/>
<gs:Locale Name="he-IL" SetAsCurrent="true" ResetAllSettings="false">


For detection of the application:

    $DefaultHive = "microsoft.powershell.core\Registry::HKEY_USERS\.DEFAULT"
    $CP = Join-Path -Path $DefaultHive -ChildPath "Control Panel\International"
    $KL = Join-Path -Path $DefaultHive -ChildPath "Keyboard Layout\Preload"
    $DHCP = Get-ItemProperty -Path $CP
    $DHKL = Get-ItemProperty -Path $KL
    if($DHCP.Locale -eq "0000040D" `
    -and $DHCP.LocaleName -eq "he-IL" `
    -and $DHCP.iCountry -eq "972" `
    -and $DHKL.1 -eq "00000409" `
    -and $DHKL.2 -eq "0000040D"){
        Write-Output "Profile international settings were copied successfully"
        exit 0
        Write-Error "Error copying profile international settings"
        exit 1
    $ErrorMessage = $_.Exception.Message
    Write-Error $ErrorMessage
    exit 1