private/BootMedia/Steps/Step-BootImageAppScript.ps1

#Requires -PSEdition Core

function Step-BootImageAppScript {
    <#
    .SYNOPSIS
        Runs user-selected WinPE app scripts during the build.
 
    .NOTES
        Author: David Segura
        Version: 0.1.0
    #>

    [CmdletBinding()]
    param ()

    $WinPEAppScript = $global:BuildMedia.WinPEAppScript

    foreach ($Item in $WinPEAppScript) {
        if (Test-Path $Item) {
            Write-OSDeployCoreProgress "winpe-appscript: $Item"
            & "$Item"
        }
        else {
            Write-Warning "BootImage App Script not found: $Item"
        }
    }
}