|
| 1 | +--- |
| 2 | +description: Command line reference for the 'dsc extension list' command |
| 3 | +ms.date: 03/25/2025 |
| 4 | +ms.topic: reference |
| 5 | +title: dsc extension list |
| 6 | +--- |
| 7 | + |
| 8 | +# dsc extension list |
| 9 | + |
| 10 | +## Synopsis |
| 11 | + |
| 12 | +Retrieves the list of available DSC extensions with an optional filter. |
| 13 | + |
| 14 | +## Syntax |
| 15 | + |
| 16 | +```sh |
| 17 | +dsc extension list [Options] <EXTENSION_NAME> |
| 18 | +``` |
| 19 | + |
| 20 | +## Description |
| 21 | + |
| 22 | +The `list` subcommand searches for available DSC extensions and returns their information. DSC |
| 23 | +discovers extensions by first searching the `PATH` or `DSC_RESOURCE_PATH` environment variable for |
| 24 | +`.dsc.extension.json`, `.dsc.extension.yml`, and `dsc.extension.yaml` files. For more information |
| 25 | +about the environment variables DSC uses, see [Environment variables][01] |
| 26 | + |
| 27 | +DSC returns the list of discovered extensions with their implementation information and metadata. If |
| 28 | +the command includes the `EXTENSION_NAME` argument, DSC filters the list of discovered extensions |
| 29 | +before returning them. Filters are always applied after extension discovery. |
| 30 | + |
| 31 | +## Examples |
| 32 | + |
| 33 | +### Example 1 - List all extensions |
| 34 | + |
| 35 | +Without any filters, the command returns every discovered DSC extension. |
| 36 | + |
| 37 | +```sh |
| 38 | +dsc extension list |
| 39 | +``` |
| 40 | + |
| 41 | +```Output |
| 42 | +Type Version Capabilities Description |
| 43 | +---------------------------------------------------------------------------------------------------------- |
| 44 | +Microsoft.Windows.Appx/Discover 0.1.0 d Discovers DSC resources packaged as Appx packages. |
| 45 | +``` |
| 46 | + |
| 47 | +### Example 2 - List a specific extension |
| 48 | + |
| 49 | +When the `EXTENSION_NAME` argument doesn't include a wildcard, the command returns only the extension |
| 50 | +with the specified type name. |
| 51 | + |
| 52 | +```sh |
| 53 | +dsc extension list Microsoft.Windows.Appx/Discover |
| 54 | +``` |
| 55 | + |
| 56 | +```Output |
| 57 | +Type Version Capabilities Description |
| 58 | +---------------------------------------------------------------------------------------------------------- |
| 59 | +Microsoft.Windows.Appx/Discover 0.1.0 d Discovers DSC resources packaged as Appx packages. |
| 60 | +``` |
| 61 | + |
| 62 | +### Example 3 - List extensions with a matching type name |
| 63 | + |
| 64 | +When the `EXTENSION_NAME` argument includes a wildcard, the command returns every extension with a |
| 65 | +matching type name. |
| 66 | + |
| 67 | +```sh |
| 68 | +dsc extension list Microsoft* |
| 69 | +``` |
| 70 | + |
| 71 | +```Output |
| 72 | +Type Version Capabilities Description |
| 73 | +---------------------------------------------------------------------------------------------------------- |
| 74 | +Microsoft.Windows.Appx/Discover 0.1.0 d Discovers DSC resources packaged as Appx packages. |
| 75 | +``` |
| 76 | + |
| 77 | +## Arguments |
| 78 | + |
| 79 | +### EXTENSION_NAME |
| 80 | + |
| 81 | +Specifies an optional filter to apply for the type names of discovered DSC extensions. The filter |
| 82 | +can include wildcards (`*`). The filter isn't case-sensitive. |
| 83 | + |
| 84 | +When this argument is specified, DSC filters the results to include only extensions where the |
| 85 | +extension type name matches the filter. |
| 86 | + |
| 87 | +For example, specifying the filter `Microsoft.*` returns only the extensions published by |
| 88 | +Microsoft. Specifying the filter `*Windows*` returns any extension with the string `Windows` in its |
| 89 | +name, regardless of the casing. |
| 90 | + |
| 91 | +```yaml |
| 92 | +Type : string |
| 93 | +Mandatory : false |
| 94 | +``` |
| 95 | +
|
| 96 | +## Options |
| 97 | +
|
| 98 | +### -o, --output-format |
| 99 | +
|
| 100 | +<a id="-o"></a> |
| 101 | +<a id="--output-format"></a> |
| 102 | +
|
| 103 | +The `--output-format` option controls which format DSC uses for the data the command returns. The |
| 104 | +available formats are: |
| 105 | + |
| 106 | +- `json` to emit the data as a [JSON Line][02]. |
| 107 | +- `pretty-json` to emit the data as JSON with newlines, indentation, and spaces for readability. |
| 108 | +- `yaml` to emit the data as YAML. |
| 109 | +- `table-no-truncate` to emit the data as a summary table without truncating each line to the |
| 110 | + current console width. |
| 111 | + |
| 112 | +The default output format depends on whether DSC detects that the output is being redirected or |
| 113 | +captured as a variable: |
| 114 | + |
| 115 | +- If the command isn't being redirected or captured, DSC displays the output as a summary table |
| 116 | + described in the [Output](#output) section of this document. |
| 117 | +- If the command output is redirected or captured, DSC emits the data as the `json` format to |
| 118 | + stdout. |
| 119 | + |
| 120 | +When you use this option, DSC uses the specified format regardless of whether the command is being |
| 121 | +redirected or captured. |
| 122 | + |
| 123 | +When the command isn't redirected or captured, the output in the console is formatted for improved |
| 124 | +readability. When the command isn't redirected or captured, the output includes terminal sequences |
| 125 | +for formatting. |
| 126 | + |
| 127 | +```yaml |
| 128 | +Type : string |
| 129 | +Mandatory : false |
| 130 | +ValidValues : [json, pretty-json, yaml, table-no-truncate] |
| 131 | +LongSyntax : --output-format <OUTPUT_FORMAT> |
| 132 | +ShortSyntax : -o <OUTPUT_FORMAT> |
| 133 | +``` |
| 134 | + |
| 135 | +### -h, --help |
| 136 | + |
| 137 | +<a id="-h"></a> |
| 138 | +<a id="--help"></a> |
| 139 | + |
| 140 | +Displays the help for the current command or subcommand. When you specify this option, the |
| 141 | +application ignores all other options and arguments. |
| 142 | + |
| 143 | +```yaml |
| 144 | +Type : boolean |
| 145 | +Mandatory : false |
| 146 | +LongSyntax : --help |
| 147 | +ShortSyntax : -h |
| 148 | +``` |
| 149 | + |
| 150 | +## Output |
| 151 | + |
| 152 | +This command returns a formatted array containing an object for each extension that includes the |
| 153 | +extension's type, version, manifest settings, and other metadata. For more information, see |
| 154 | +[dsc extension list result schema][03]. |
| 155 | + |
| 156 | +If the output of the command isn't captured or redirected, it displays in the console by default as |
| 157 | +a summary table for the returned extensions. The summary table includes the following columns, |
| 158 | +displayed in the listed order: |
| 159 | + |
| 160 | +- **Type** - The fully qualified type name of the extension. |
| 161 | +- **Version** - The semantic version of the extension. |
| 162 | +- **Capabilities** - A display of the extension's [capabilities][04] as flags. The capabilities are |
| 163 | + displayed in the following order, using a `-` instead of the appropriate letter if the extension |
| 164 | + doesn't have a specific capability: |
| 165 | + |
| 166 | + - `d` indicates that the extension has the [discover capability][05]. |
| 167 | + |
| 168 | + For example, the `icrosoft.Windows.Appx/Discover` extension has the following capabilities: `d`, |
| 169 | + indicating it has the `discover` capability. |
| 170 | +- **Description** - The short description of the extension's purpose and usage. |
| 171 | + |
| 172 | +For more information about the formatting of the output data, see the |
| 173 | +[--output-format option](#--output-format). |
| 174 | + |
| 175 | +<!-- Link reference definitions --> |
| 176 | +[01]: ../index.md#environment-variables |
| 177 | +[02]: https://jsonlines.org/ |
| 178 | +[03]: ../../schemas/outputs/extension/list.md |
| 179 | +[04]: ../../schemas/outputs/extension/list.md#capabilities |
| 180 | +[05]: ../../schemas/outputs/extension/list.md#capability-discover |
0 commit comments