Many ESXCLI commands generate output you might want to use in your application. You can run esxcli
with the --formatter dispatcher option and send the resulting output as input to a parser.
The --formatter option supports three values - csv
, xml
, and keyvalue
and is used before any namespace.
The following example lists all file system information in CSV format.
esxcli --formatter=csv storage filesystem list
You can pipe the output to a file.
esxcli --formatter=keyvalue storage filesystem list > myfilesystemlist.txt
Important: You should always use a formatter for consistent output.