-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Templates] Fix template scripts, make them more flexible and robust #57841
Conversation
param( | ||
[Parameter(Mandatory = $false, Position = 0)] | ||
[ValidateSet("net9.0", "net10.0")] | ||
[string] $Framework = "net9.0", | ||
[Parameter(Mandatory = $false)] | ||
[switch] $ExcludeLaunchSettings, | ||
[Parameter(Mandatory = $false)] | ||
[ValidateSet("None", "Individual")] | ||
[string] $Auth = "None", | ||
[Parameter(Mandatory = $false)] | ||
[switch] $UseLocalDb, | ||
[Parameter(Mandatory = $false)] | ||
[switch] $NoHttps, | ||
[Parameter(Mandatory = $false)] | ||
[switch] $UseProgramMain, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, I asked copilot to generate this, as well as the code that maps it into the variable by giving the output from dotnet new <<template>> -h
. In case someone wants to update other scripts in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good
|
1034a87
to
a315d25
Compare
Provides an updated
Test-Templates
module with a newTest-Template
function to create a given template and replaces the oldTest-Templates.ps1
script, which has been left there forother
template scripts.The new command allows passing parameters to the templates instead of hardcoding them into the wrapping scripts and the wrapping commands expose specific parameters for the templates they instantiate.
Other wrapping scripts have been left untouched.