PSModule / Build-PSModule

Action that is used to build a PowerShell module.
https://psmodule.io
MIT License
2 stars 0 forks source link

🌞 [Other]: ArgumentCompleter #55

Open webalexeu opened 4 months ago

webalexeu commented 4 months ago

Description

Hello,

I'm trying to use an ArgumentCompleter in my module but I don't know where to define it properly to be build correclty

Thanks for your support, Alexandre

MariusStorhaug commented 4 months ago

Hey, and thank you for using the framework!

I only have an example of this in the Fonts module, where I register a completer in the same file, but the function could be located in the private folder. The private functions are loaded first, then public functions (which will be exported).

webalexeu commented 4 months ago

Thank you for your quick answer

I finally use the init folder as my argument completer is used by multiple cmdlets but thanks for the exemple

I've another question, I was thinking that variable (included in data folder) will be declared with

-Scope Script

but that's not. I was guessing it will be due to this document note

Adds data loader automation that loads files from the data folder as variables in the module scope, if it exists. The variables are available using the ´$script:´ syntax.