private/BootMedia/Steps/Step-BootImageIso.ps1

#Requires -PSEdition Core

function Step-BootImageIso {
    <#
    .SYNOPSIS
        Creates bootable ISO file(s) from the build media using oscdimg.exe.
 
    .NOTES
        Author: David Segura
        Version: 0.1.0
    #>

    [CmdletBinding()]
    param ()

    $AdkRootPath = $global:BuildMedia.AdkRootPath
    $MediaIsoLabel = $global:BuildMedia.MediaIsoLabel
    $MediaPath = $global:BuildMedia.MediaPath
    $MediaPathEX = $global:BuildMedia.MediaPathEX
    $MediaRootPath = $global:BuildMedia.MediaRootPath

    Write-OSDeployCoreProgress "Creating bootable ISO in $MediaRootPath"

    $Params = @{
        MediaPath      = $MediaPath
        IsoFileName    = 'bootmedia.iso'
        IsoLabel       = $MediaIsoLabel
        WindowsAdkRoot = $AdkRootPath
        IsoDirectory   = $MediaRootPath
    }
    New-WindowsAdkISO @Params | Out-Null

    if ($MediaPathEX) {
        $Params = @{
            MediaPath      = $MediaPathEX
            IsoFileName    = 'bootmedia_ca2023.iso'
            IsoLabel       = $MediaIsoLabel
            WindowsAdkRoot = $AdkRootPath
            IsoDirectory   = $MediaRootPath
        }
        New-WindowsAdkISO @Params | Out-Null
    }
}