Skip to content

Conversation

javiercn
Copy link
Member

Provides an updated Test-Templates module with a new Test-Template function to create a given template and replaces the old Test-Templates.ps1 script, which has been left there for other 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.

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Sep 12, 2024
Comment on lines +6 to +20
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,
Copy link
Member Author

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.

@javiercn javiercn force-pushed the javiercn/fix-template-test-scripts branch from 1034a87 to a315d25 Compare September 13, 2024 18:45
@javiercn javiercn merged commit d05f358 into main Sep 18, 2024
27 checks passed
@javiercn javiercn deleted the javiercn/fix-template-test-scripts branch September 18, 2024 07:58
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Sep 18, 2024
captainsafia pushed a commit that referenced this pull request Dec 31, 2024
…57841)

* Fix template scripts, make them more flexible and robust
captainsafia pushed a commit that referenced this pull request Feb 11, 2025
…57841)

* Fix template scripts, make them more flexible and robust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants