Invoke Module
- 14 May 2021
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
Invoke Module
- Updated on 14 May 2021
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.
Invoke Module
Executes an OtterScript module stored in BuildMaster.
Script usage:
Invoke-Module( Module: <text>, [Arguments: <%(key1: value1, ...)>], [CaptureOutputArguments: <@(text)>] );
This operation may be prefixed with BuildMaster::
, although this is a built-in namespace and isn't really necessary.
Arguments:
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Module (default) | text | Module | This argument is required. |
Arguments | %(key1: value1, ...) | Arguments | Specify arguments to pass in to the module using a map. If any required values are not supplied, a runtime error will be raised. For example: %(arg1: value, arg2: @(list,of,items)) |
Capture output arguments | @(text) | CaptureOutputArguments | Specify output arguments to capture and set in the calling scope as variables using a list. For example: @(filePath,errorMessage) |
Note: Runtime variables you've defined before executing an Invoke operation will not be visible to the invoked script, and variables that you set within the invoked script will not be available.
Example:
# This will call the global "MyModule" module and pass in an argument called $name with value "Steve" Invoke-Module global::MyModule ( AdditionalArguments: %(name: Steve) );
Was this article helpful?