private/Initialize-OSDeployCorePaths.ps1
|
#Requires -PSEdition Core function Initialize-OSDeployCorePaths { <# .SYNOPSIS Creates the directory structure for OSDeployCore paths. .DESCRIPTION Ensures all required OSDeployCore directories exist under $env:ProgramData\OSDeployCore. Creates the following structure: - boot - cache - cache/config - cache/downloads - cache/hashes - cache/psrepository - cache/windows-os - cache/windows-re - cache/winpe-apps - OSDCloud/OS/<Version> (created on-demand by Update-OSDeployCoreESD) - OSDRepo/build-profiles/amd64 - OSDRepo/build-profiles/arm64 - OSDRepo/media-script - OSDRepo/winpe-appscript - OSDRepo/winpe-drivers - OSDRepo/winpe-profiles - OSDRepo/winpe-script - OSDRepo/winpe-wallpaper .NOTES Author: David Segura Company: Recast Software Change Summary: Dependencies: Module Functions: Update-OSDeployCoreESD Windows Features: Windows ADK WinPE Addon #> [CmdletBinding()] param () $paths = @( (Join-Path $Script:OSDeployCorePath 'boot'), (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:OSDeployOSDRepoPath 'build-profiles' 'amd64'), (Join-Path $script:OSDeployOSDRepoPath 'build-profiles' 'arm64'), (Join-Path $Script:OSDeployOSDRepoPath 'media-script'), (Join-Path $Script:OSDeployOSDRepoPath 'winpe-appscript'), (Join-Path $Script:OSDeployOSDRepoPath 'winpe-profiles'), (Join-Path $Script:OSDeployOSDRepoPath 'winpe-script'), (Join-Path $Script:OSDeployOSDRepoPath 'winpe-wallpaper'), (Join-Path $script:OSDeployOSDRepoPath 'winpe-drivers' 'amd64'), (Join-Path $script:OSDeployOSDRepoPath '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" } } } |