dotnet / dotnet-template-samples

Samples showing how to create templates using the Template Engine for dotnet new and Visual Studio

Home Page:https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-new

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expression/Condition in parameter default value

jnevins-gcm opened this issue · comments

Is there a way to make a parameter defaultValue conditional/based on an expression?

I want to have


		"fileToRename": {
			"type": "parameter",
			"datatype": "string",
                        "defaultValue": "if(boolParam) then TheSpecialFile.txt else TheFile.txt",
			"replaces": "TheFile.txt",
			"fileRename": "TheFile.txt"
		},

Hi, is there anyone that can reply to this? A simple yes/no would suffice.

Hi @jnevins-gcm can you post this to https://github.com/dotnet/templating/issues instead of here? You're much more likely to get a timely reply there.