Skip to content

Add TemplateName parameter to Invoke-Plaster with argument completer#447

Open
joshooaj wants to merge 2 commits intoPowerShellOrg:v2from
joshooaj:feat/add-templatename-param
Open

Add TemplateName parameter to Invoke-Plaster with argument completer#447
joshooaj wants to merge 2 commits intoPowerShellOrg:v2from
joshooaj:feat/add-templatename-param

Conversation

@joshooaj
Copy link
Copy Markdown

@joshooaj joshooaj commented Apr 8, 2026

This PR is purely a convenience change which makes it possible to skip using Get-PlasterTemplate and instead use the -TemplateName parameter and tab through the available options.

This...

$template = Get-PlasterTemplate | Where-Object Name -eq NewPowerShellModule
Invoke-Plaster -TemplatePath $template.TemplatePath -DestinationPath .\MyNewModule

Becomes this...

Invoke-Plaster -TemplateName NewPowerShellModule -DestinationPath .\MyNewModule

@HeyItsGilbert
Copy link
Copy Markdown
Collaborator

How would this work for multiple versions?

@joshooaj
Copy link
Copy Markdown
Author

joshooaj commented Apr 8, 2026

Oh good Q, not sure yet. I'll look into it when I get back to my desk!

@joshooaj
Copy link
Copy Markdown
Author

joshooaj commented Apr 8, 2026

I was thinking about an optional -TemplateVersion parameter in the TemplateName parameterset, so I installed a couple different versions of the Templates module to try it out and noticed you can have multiple module versions with the same template version in them.

So maybe...

  • If only one matching template is found, just use it, no need to specify version.
  • If the version is provided and it's unique, use it.
  • If the there are multiple versions and the version wasn't specified, prompt to pick one?
  • If there are multiple versions but the version numbers aren't unique, throw an error and tell the user to grab the template path using Get-PlasterTemplate instead?
image

@HeyItsGilbert
Copy link
Copy Markdown
Collaborator

Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants