private/Core/Initialize-OSDeployCoreBootImage.ps1

#Requires -PSEdition Core

function Initialize-OSDeployCoreBootImage {
    <#
    .SYNOPSIS
        Creates the directory structure for OSDeployCore paths.
 
    .DESCRIPTION
        Ensures all required OSDeployCore directories exist under $env:ProgramData\OSDeployCore.
        Creates the following structure:
        - boot-media
        - cache
        - cache/config
        - cache/downloads
        - cache/hashes
        - cache/psrepository
        - cache/windows-os
        - cache/windows-re
        - cache/winpe-apps
        - Repository/build-profiles
        - Repository/media-script
        - Repository/winpe-appscript
        - Repository/winpe-drivers
        - Repository/winpe-profiles
        - Repository/winpe-script
        - Software
 
    .NOTES
        Author: David Segura
        Company: Recast Software
        Change Summary:
    #>

    [CmdletBinding()]
    param ()

    $paths = @(
        (Join-Path $Script:OSDeployCorePath 'boot-media'),
        (Join-Path $Script:OSDeployCorePath 'cache'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'config'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'downloads'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'hashes'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'psrepository'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'windows-os'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'windows-re'),
        (Join-Path $Script:OSDeployCorePath 'cache' 'winpe-apps'),
        (Join-Path $script:OSDeployCoreRepositoryPath 'build-profiles'),
        (Join-Path $Script:OSDeployCoreRepositoryPath 'media-script'),
        (Join-Path $Script:OSDeployCoreRepositoryPath 'winpe-appscript'),
        (Join-Path $Script:OSDeployCoreRepositoryPath 'winpe-profiles'),
        (Join-Path $Script:OSDeployCoreRepositoryPath 'winpe-script'),
        (Join-Path $Script:OSDeployCoreRepositoryPath 'winpe-wallpaper'),
        (Join-Path $script:OSDeployCoreRepositoryPath 'winpe-drivers' 'amd64'),
        (Join-Path $script:OSDeployCoreRepositoryPath 'winpe-drivers' 'arm64')
    )

    foreach ($path in $paths) {
        if (-not (Test-Path -Path $path)) {
            New-Item -ItemType Directory -Path $path -Force | Out-Null
            Write-Verbose "Created directory: $path"
        }
    }
}