Crescendo icon indicating copy to clipboard operation
Crescendo copied to clipboard

Cannot find function when generating module from Schema file

Open steviecoaster opened this issue 3 years ago • 4 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues.

Steps to reproduce

I've created a function for parsing the output of handle.exe to help improve an existing Crescendo module from Adam Driscoll. You can find this module here.

I've written my function and loaded it into my running session, and can confirm that doing something like handle.exe | Read-HandleOutput produces expected results for me.

I've defined the OutputHandler as such in my schema:

"OutputHandlers": [
        {
          "ParameterSetName": "default",
          "Handler": "Read-HandleOutput",
          "HandlerType": "Function",
          "StreamOutput": false
        }
      ]

I'm receiving the following when attempting to create the module from the schema:

image

I've used this process for other Crescendo modules I've worked on in the past with success, so I'm not entirely sure what I'm missing here?

Gist of the json file being used to produce this module is at https://gist.github.com/steviecoaster/5926d335d8008bfd4d9ab7b5ca454a92

Expected behavior

I expect the module to be produced, and consumable for use.

Actual behavior

See error in description

Error details

No response

Environment data

PowerShell Version info:



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

Version

1.0.0

Visuals

2022-07-28_15-27-50 (1)

steviecoaster avatar Jul 28 '22 19:07 steviecoaster

There's a message that's being generated when you run Export-CrescendoModule indicating that the function cannot be found, so when the module is exported, that function will not be included and you'll get the behavior you see. Please make sure that the function is in the environment where you generate the module (or add it to the module afterwards).

JamesWTruher avatar Aug 01 '22 19:08 JamesWTruher

@steviecoaster - If you get a chance, can you confirm Jim's response -- We believe there is an error message that is being displayed indicating that the function can not be found. Load the function, then run Export-CrescendoModule and it should work as expected.

theJasonHelmick avatar Aug 09 '22 20:08 theJasonHelmick

@theJasonHelmick @JamesWTruher my gif shows that the function is loaded. I try to export the module, get the error, then I run the function directly to show that it has been in fact loaded in the session, but it is never picked up by Crescendo.

This works for other Crescendo modules I've done. Just...not this one. And I am terrible confused by it!

steviecoaster avatar Sep 05 '22 02:09 steviecoaster

@steviecoaster could you also include the output of the following:

get-command -all Read-HandleOutput

JamesWTruher avatar Oct 03 '22 17:10 JamesWTruher