Is there a way to Pass Parameters to C# Scripts via the CLI (specifically within DevOps)? #1481
Unanswered
corycundy
asked this question in
🙋♀️TE3 Q&A
Replies: 1 comment 1 reply
|
Hi Cory, Just to be clear, are you asking for a way to put the parameter on the CLI itself, and then have the C# script pick it up? So something like: MyScript.csx: var arg1 = CliParams["CustomArg1"];
Info("You passed in: " + arg1);And then in the CLI: TabularEditor.exe AdventureWorks.bim -S MyScript.csx CustomArg1:"Hello world!"Or something like that? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Within a DevOps pipeline it would be very helpful to be able to pass parameters to a C# script via the TE CLI.
The only way it seems to be possible is to either read an environment variable from DevOps or figure a way to read the parameter from a file. Neither of these is ideal as they are not as dynamic or won't have the context of a value depending on where you are in a loop or other logic within the pipeline.
For example, if looping over a configurations for multiple models a parameter may be set to true for some models and false for others. The ability to pass it into a script allows the context of the logic calling the script to decide vs. trying to have the script figure out what to go and get.
This could work in the very same way as passing parameters to a CLI itself. The script can then check for specific parameters and determine what to do.
Before I post this as a feature request, I wanted to see if there is currently a way to do this.
Cory
All reactions