diff --git a/docs/core/tools/dotnet-list-package.md b/docs/core/tools/dotnet-list-package.md index 5295dfd8e3628..c5a5d1ba87f15 100644 --- a/docs/core/tools/dotnet-list-package.md +++ b/docs/core/tools/dotnet-list-package.md @@ -20,6 +20,8 @@ dotnet list [|] package [--config ] [--include-prerelease] [--include-transitive] [--interactive] [--outdated] [--source ] [-v|--verbosity ] [--vulnerable] + [--format ] + [--output-version ] dotnet list package -h|--help ``` @@ -118,6 +120,14 @@ The project or solution file to operate on. If not specified, the command search Lists packages that have known vulnerabilities. Cannot be combined with `--deprecated` or `--outdated` options. Nuget.org is the source of information about vulnerabilities. For more information, see [Vulnerabilities](/nuget/api/registration-base-url-resource) and [How to Scan NuGet Packages for Security Vulnerabilities](https://devblogs.microsoft.com/nuget/how-to-scan-nuget-packages-for-security-vulnerabilities/). +- **`--format `** + + Sets the report output format. Allowed values are `console`, `json`. Defaults to `console`. + +- **`--output-version `** + + Sets the report output version. Allowed value is `1`. Defaults to `1`. Requires the `--format json` option. When a new JSON version is available, the command will produce the new format by default. This option will let you specify that the command should produce an earlier format. + ## Examples - List package references of a specific project: @@ -137,3 +147,27 @@ The project or solution file to operate on. If not specified, the command search ```dotnetcli dotnet list package --framework netcoreapp3.0 ``` + +- List package references in machine readable json output format: + + ```dotnetcli + dotnet list package --format json + ``` + +- List package references for a specific target framework in machine readable json output format: + + ```dotnetcli + dotnet list package --framework netcoreapp3.0 --format json + ``` + +- Save machine readable json output of package references, including transitive dependency and vulnerability details into a file: + + ```dotnetcli + dotnet list package --include-transitive --vulnerable --format json >> dependencyReport.json + ``` + +- List package references in machine readable json output format with output version 1: + + ```dotnetcli + dotnet list package --format json --output-version 1 + ```