I would like to have a file named template.ps.psm1 and within that, parse the actual value. Here's what I tried
$global:currentmodule = $script:module.Name
Build-PipeScript $root\build\template.ps.psm1
And within template, I had
$thismodule = '' <#{
"'$global:currentmodule'"
}#>
This only worked if I named it template-psm.ps.psd1