PowerShell / Crescendo

a module for wrapping native applications in a PowerShell function and module
MIT License
397 stars 37 forks source link

Build can't be easily automated when a parser function is needed #201

Open DennisL68 opened 1 year ago

DennisL68 commented 1 year ago

Prerequisites

Steps to reproduce

Create a build script for a Crescendo configuration that requires an external script for parsing

. "$PSScriptRoot\helpers\parse.ps1"

Export-CrescendoModule -ConfigurationFile "$PSScriptRoot\crescendo\mycommand.json" -ModuleName MyCommand -Force

Expected behavior

The functions in parse.ps1 should be available for Export-CrescendoModule

(I'm actually not sure they will be available for any external scripts unless deployed from a console that has had the functions dot sourced.)

Actual behavior

Crescendo fails with error

Work around is to dot source the script by hand into the console that starts the build script

Error details

Exception: Cannot find output handler function 'XXX'.

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.10
PSEdition                      Core
GitCommitId                    7.2.10
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

1.1.0

Visuals

No response