Public/New-OSDBuilderContentPack.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
<#
.SYNOPSIS Creates an OSDBuilder ContentPack .DESCRIPTION Creates or Updates an OSDBuilder ContentPack in the ContentPack directory .LINK https://osdbuilder.osdeploy.com/module/functions/new-osdbuildercontentpack #> function New-OSDBuilderContentPack { [CmdletBinding()] param ( #Name of the ContentPack to create [Parameter(Position = 0, Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Name, #Content Pack Type [ValidateSet('All','OS','WinPE','MultiLang')] [string]$ContentType = 'All' ) $OSContentPack = @( 'Media\ALL' 'Media\x64' #'Media\x86' 'OSDrivers\ALL' 'OSDrivers\x64' #'OSDrivers\x86' 'OSExtraFiles\ALL' 'OSExtraFiles\ALL Subdirs' 'OSExtraFiles\x64' 'OSExtraFiles\x64 Subdirs' 'OSPoshMods\ProgramFiles' 'OSPoshMods\System' 'OSRegistry\ALL' 'OSRegistry\x64' #'OSRegistry\x86' 'OSScripts\ALL' 'OSScripts\x64' #'OSScripts\x86' 'OSStartLayout\ALL' 'OSStartLayout\x64' #'OSStartLayout\x86' ) $PEContentPack = @( 'PEDaRT' 'PEDrivers\ALL' 'PEDrivers\x64' #'PEDrivers\x86' 'PEExtraFiles\ALL' 'PEExtraFiles\ALL Subdirs' 'PEExtraFiles\x64' 'PEExtraFiles\x64 Subdirs' #'PEExtraFiles\x86' #'PEExtraFiles\x86 Subdirs' 'PEPoshMods\ProgramFiles' 'PEPoshMods\System' 'PERegistry\ALL' 'PERegistry\x64' #'PERegistry\x86' 'PEScripts\ALL' 'PEScripts\x64' #'PEScripts\x86' ) $MultiLangContentPack = @() #================================================= # Get-OSDBuilder #================================================= Get-OSDBuilder -HideDetails #================================================= # OSContentPack #================================================= if (($ContentType -eq 'All') -or ($ContentType -eq 'OS')) { foreach ($item in $OSContentPack) { if (!(Test-Path (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item"))) { New-Item (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item") -ItemType Directory -Force | Out-Null } } } #================================================= # PEContentPack #================================================= if (($ContentType -eq 'All') -or ($ContentType -eq 'WinPE')) { foreach ($item in $PEContentPack) { if (!(Test-Path (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item"))) { New-Item (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item") -ItemType Directory -Force | Out-Null } } } #================================================= # MultiLangContentPack #================================================= if (($ContentType -eq 'All') -or ($ContentType -eq 'MultiLang')) { foreach ($item in $MultiLangContentPack) { if (!(Test-Path (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item"))) { New-Item (Join-Path $SetOSDBuilderPathContentPacks "$Name\$item") -ItemType Directory -Force | Out-Null } } } } |