Skip to content

Commit

Permalink
Re-add temporary revert changes "Document machine readable json outpu…
Browse files Browse the repository at this point in the history
…t for dotnet list package report (#32855)" (#33516)" (#33518)

This reverts commit 8643439.
  • Loading branch information
erdembayar committed Feb 18, 2023
1 parent 2f3de81 commit 13a80f8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/core/tools/dotnet-list-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dotnet list [<PROJECT>|<SOLUTION>] package [--config <SOURCE>]
[--include-prerelease] [--include-transitive] [--interactive]
[--outdated] [--source <SOURCE>] [-v|--verbosity <LEVEL>]
[--vulnerable]
[--format <console|json>]
[--output-version <VERSION>]
dotnet list package -h|--help
```
Expand Down Expand Up @@ -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 <console|json>`**

Sets the report output format. Allowed values are `console`, `json`. Defaults to `console`.

- **`--output-version <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:
Expand All @@ -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
```

0 comments on commit 13a80f8

Please sign in to comment.