'Is there a way to list down only the custom dotnet templates installed?

dotnet new --list lists all the built-in and custom templates installed. But I want to list only the custom templates that I have created and installed. Is there a way to do that?



Solution 1:[1]

If you have author specified in you template for example:

{
  "$schema": "http://json.schemastore.org/template",
  "author": "MyCompany",
  "classifications": [ "Item" ],
  "identity": "MyCompany.Templates.Documentation",
  "name": "Documentation template",
  "shortName": "documentation",
  "preferNameDirectory": false,
  "tags": {
    "type": "item"
  }
}

then you can filter it by that company name: dotnet new --list --author MyCompany.

I'm aware that this solution is very limited but at least works when I want to list only my templates.

NOTE: the syntax is valid for .NET SDK 6.0.100. For (currently in preview) version .NET SDK 7.0.100 it is dotnet new list --author MyCompany

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sarrus