Public/PostProcessor.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
function PostProcessor { [CmdletBinding()] param( [Parameter( Mandatory = $true)] [string]$Name ) try { $path = Join-Path -Path $Script:ThisPackerInfo.Source -ChildPath "PostProcessors\$Name.json" if (Test-Path -Path $path) { $Script:ThisPackerFile.'post-processors' += Get-Content -Path $path | ConvertFrom-Json } else { throw "PostProcessor: $path - not found!" } } catch { throw $PSItem } } |