1. Packages
  2. Local Provider
  3. API Docs
  4. getCommand
local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp
local logo
local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp

    Example Usage

    Using getCommand

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCommand(args: GetCommandArgs, opts?: InvokeOptions): Promise<GetCommandResult>
    function getCommandOutput(args: GetCommandOutputArgs, opts?: InvokeOptions): Output<GetCommandResult>
    def get_command(allow_non_zero_exit_code: Optional[bool] = None,
                    arguments: Optional[Sequence[str]] = None,
                    command: Optional[str] = None,
                    stdin: Optional[str] = None,
                    working_directory: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetCommandResult
    def get_command_output(allow_non_zero_exit_code: Optional[pulumi.Input[bool]] = None,
                    arguments: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    command: Optional[pulumi.Input[str]] = None,
                    stdin: Optional[pulumi.Input[str]] = None,
                    working_directory: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetCommandResult]
    func GetCommand(ctx *Context, args *GetCommandArgs, opts ...InvokeOption) (*GetCommandResult, error)
    func GetCommandOutput(ctx *Context, args *GetCommandOutputArgs, opts ...InvokeOption) GetCommandResultOutput

    > Note: This function is named GetCommand in the Go SDK.

    public static class GetCommand 
    {
        public static Task<GetCommandResult> InvokeAsync(GetCommandArgs args, InvokeOptions? opts = null)
        public static Output<GetCommandResult> Invoke(GetCommandInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCommandResult> getCommand(GetCommandArgs args, InvokeOptions options)
    public static Output<GetCommandResult> getCommand(GetCommandArgs args, InvokeOptions options)
    
    fn::invoke:
      function: local:index/getCommand:getCommand
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Command string
    Executable name to be discovered on the PATH or absolute path to executable.
    AllowNonZeroExitCode bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    Arguments List<string>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    Stdin string
    WorkingDirectory string
    Command string
    Executable name to be discovered on the PATH or absolute path to executable.
    AllowNonZeroExitCode bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    Arguments []string
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    Stdin string
    WorkingDirectory string
    command String
    Executable name to be discovered on the PATH or absolute path to executable.
    allowNonZeroExitCode Boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments List<String>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin String
    workingDirectory String
    command string
    Executable name to be discovered on the PATH or absolute path to executable.
    allowNonZeroExitCode boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments string[]
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin string
    workingDirectory string
    command str
    Executable name to be discovered on the PATH or absolute path to executable.
    allow_non_zero_exit_code bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments Sequence[str]
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin str
    working_directory str
    command String
    Executable name to be discovered on the PATH or absolute path to executable.
    allowNonZeroExitCode Boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments List<String>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin String
    workingDirectory String

    getCommand Result

    The following output properties are available:

    Command string
    Executable name to be discovered on the PATH or absolute path to executable.
    ExitCode double
    Id string
    The provider-assigned unique ID for this managed resource.
    Stderr string
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    Stdout string
    AllowNonZeroExitCode bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    Arguments List<string>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    Stdin string
    WorkingDirectory string
    Command string
    Executable name to be discovered on the PATH or absolute path to executable.
    ExitCode float64
    Id string
    The provider-assigned unique ID for this managed resource.
    Stderr string
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    Stdout string
    AllowNonZeroExitCode bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    Arguments []string
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    Stdin string
    WorkingDirectory string
    command String
    Executable name to be discovered on the PATH or absolute path to executable.
    exitCode Double
    id String
    The provider-assigned unique ID for this managed resource.
    stderr String
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    stdout String
    allowNonZeroExitCode Boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments List<String>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin String
    workingDirectory String
    command string
    Executable name to be discovered on the PATH or absolute path to executable.
    exitCode number
    id string
    The provider-assigned unique ID for this managed resource.
    stderr string
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    stdout string
    allowNonZeroExitCode boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments string[]
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin string
    workingDirectory string
    command str
    Executable name to be discovered on the PATH or absolute path to executable.
    exit_code float
    id str
    The provider-assigned unique ID for this managed resource.
    stderr str
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    stdout str
    allow_non_zero_exit_code bool
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments Sequence[str]
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin str
    working_directory str
    command String
    Executable name to be discovered on the PATH or absolute path to executable.
    exitCode Number
    id String
    The provider-assigned unique ID for this managed resource.
    stderr String
    Data returned from the command's standard error stream. The data is returned directly from the command as a UTF-8 string and will be populated regardless of the exit code returned.
    stdout String
    allowNonZeroExitCode Boolean
    Indicates that the command returning a non-zero exit code should be treated as a successful execution. Further assertions can be made of the exit_code value with the check block. Defaults to false.
    arguments List<String>
    Arguments to be passed to the given command. Any null arguments will be removed from the list.
    stdin String
    workingDirectory String

    Package Details

    Repository
    local hashicorp/terraform-provider-local
    License
    Notes
    This Pulumi package is based on the local Terraform Provider.
    local logo
    local 2.6.1 published on Monday, Nov 17, 2025 by hashicorp
      Meet Neo: Your AI Platform Teammate