Skip to content

Conversation

potatoqualitee
Copy link
Member

Fixes #9814 this should probably be standardized to all commands

@niphlod / @andreasjordan tell me if you like this pattern. if so, i can add repo-wide wildcard support and update the help.

@andreasjordan
Copy link
Contributor

I like the idea. But... for all the commands? For all the parameters? Can we move the functionality to an internal function? Or have a code block that is exactly the same for all commands to fix bugs "one fix for all"? This would break in environments with wildcards in names. Do we add a switch like in Connect-DbaInstance some time ago when I changed the code?

I would not implement this without deep consideration.

@potatoqualitee
Copy link
Member Author

No no, sorry I wasn't clear. It would be all commands with -Database, -ExcludeDatabase, -Login, -Job and perhaps others. Not a bad idea to make it an internal command!

@niphlod
Copy link
Contributor

niphlod commented Aug 26, 2025 via email

@potatoqualitee
Copy link
Member Author

thank you @niphlod ! i may have agreed at the time, but i'd like to change my position 😅 I think if someone does a *, it's very intentional and they want a wildcard. that does remind me, that we'd have to ensure brackets on the outside arent processed. or maybe its okay if they are, i'd have to check. whatcha think?

@niphlod
Copy link
Contributor

niphlod commented Aug 26, 2025 via email

@mattcargile
Copy link
Contributor

I would love [WildcardPattern] ( or -like ) in all the Get- much like Get-Process and Get-Service and many other commands. Having Find- for everything that supports -match would be nice too. For simple matches, it would help someone who is typically inside the shell and not using SSMS as much. A project for aliases on the -Parameters would be awesome too. Lastly, optimizing positional parameters would round out the interactive optimizations. So the most common types of executions would be isolated like Get-DbaDatabase SqlInstance Database should return SqlInstance.Database. I don't think having -SqlCredential as the second positional parameter is all that optimal.

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.

Get-DbaDatabase -Database and -ExcludeUser parameters do not accept wildcards as documented
4 participants