public/Get-WpcGeneratedFileHeader.ps1

function Get-WpcGeneratedFileHeader {
    param(
        [Parameter(Mandatory = $true)]
        [string] $SourceFileName,

        [string] $SourceDirectoryLabel = '.woodpecker-src',

        [string] $GeneratorPath = 'WoodpeckerTools/Invoke-WoodpeckerPipelineCompiler',

        [string] $ReferencePath = 'https://github.com/serrnovik/woodpecker-tools',

        [string] $TechSpecPath
    )

    $headerLines = [System.Collections.Generic.List[string]]@(
        '# AUTO-GENERATED FILE. DO NOT EDIT DIRECTLY.'
        "# Source: $($SourceDirectoryLabel.TrimEnd('/'))/$SourceFileName"
        "# Generator: $GeneratorPath"
    )
    if (-not [string]::IsNullOrWhiteSpace($ReferencePath)) {
        $headerLines.Add("# Reference: $ReferencePath")
    }
    if (-not [string]::IsNullOrWhiteSpace($TechSpecPath)) {
        $headerLines.Add("# Tech spec: $TechSpecPath")
    }

    return $headerLines -join "`n"
}