variable_string_from_command

Define a variable from a command output.

⚙️ Compatible targets: Linux, Windows

Parameters

NameDocumentation
prefixThe prefix of the variable name.

This parameter is required.
nameThe variable to define, the full name will be prefix.name.

This parameter is required.
commandThe command to execute.

This parameter is required.

Example

method: variable_string_from_command
params:
  prefix: VALUE
  name: VALUE
  command: VALUE

Documentation

Define a variable from a command output. The method will execute a shell command and define a variable ${prefix.name} from it.

  • Only stdout is kept
  • The variable will only be defined if the exit code of the command is 0
  • If the variable definition is successful, the method will report a success, it will report an error otherwise.
  • The command will be executed even in Audit mode