Calls to actions/Invoke-OSAction.ps1 share a core set of flags and environment variables.
-LogLevelControls logging verbosity. Allowed values: ERROR, WARN, INFO (default), DEBUG.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{}' -LogLevel DEBUG
-DryRunPrints the adapter invocation without executing it.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{}' -DryRun
-FailOnUnknownTreats unsupported parameters as errors. By default, the dispatcher ignores unknown parameters and emits a warning. Specify -FailOnUnknown to throw instead.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{}' -FailOnUnknown
-WorkingDirectoryRuns the adapter after changing to the specified directory using -WorkingDirectory.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{}' -WorkingDirectory src
-ListActionsLists available actions then exits.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ListActions
-DescribeShows the parameters for a specific action then exits.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -Describe run-unit-tests
gcliPathOptional path to the NI g-cli executable. When provided in args_json, the dispatcher prepends it to PATH. Default: assumes g-cli is already on PATH.
Example:
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{"gcliPath":"/opt/gcli/bin"}'
PSModulePathPowerShell uses this variable to locate modules. The dispatcher honors the value inherited from the environment. Override it before invoking the dispatcher to load custom modules.
Example:
$env:PSModulePath = "$PWD/modules"
pwsh ./actions/Invoke-OSAction.ps1 -ActionName run-unit-tests -ArgsJson '{}'