output
Specifies a file where you want a command to write the output if the command executes successfully. If you do not specify the {--output | -o} option, the command writes the output to the console.
Syntax
--output | -o file
Arguments
Argument | Description |
file | Specifies the file where you want the output written. If the file you specify does not exist, the command creates it. You can specify: Absolute directory path and filename. Relative directory path and filename. The path is relative from where you initiated the command. Filename of a file in the same directory where you initiated the command. |
Usage Notes
If the file you specify with the
{--output | -o} option already exists, the command overwrites the existing file with the new service results.
If a command results in an error, the command writers the error output to the location specified by the
{--error | -r} option or the console if the
{--error | -r} option is not specified.
Examples
To write output to a file named “results.xml” in the directory c:\outputs:
--output c:\outputs\results.xml
To write output to a file named “results.json” in the \outputs directory relative to where you initiate the command:
--output outputs\results.json
To write output to a file named “results” in the same directory from where you initiate the command:
--output results
In this example, the command determines the file extension based on the request content type.