dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.47k stars 803 forks source link

Dbatools configuration profiles #8767

Open wsmelton opened 1 year ago

wsmelton commented 1 year ago

Summarize Functionality

Right now, we default a few configurations that are meant to be for pure interaction and not automation (non-interactive) uses with the module. Big example is the TEPP configuration, by default tabexpansion.disable is set to false.

The average use of our module I think now-a-days is purely non-interactive. Those that use it for interactive purposes to check things here-and-there is less than those writing scripts and automating workflows against SQL Server.

I think one of two things can be done:

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

If we go the route of profiles...

Create a parameter that would be used like: Set-DbatoolsConfig -Profile Interactive or Set-DbatoolsConfig -Profile NonInteractive

The workflow for each parameter value would set the associated configurations to disable (NonInteractive) or enable (Interactive).

We have some values that for example the configuration item is to disable it, so by default it is enabled (Get-DbatoolsConfig -Module tabexpansion). In the scenario of non-interactive, that profile would set tabexpansion.disable to true, and opposite the interactive profile setting this would be set to false.

mattcargile commented 1 year ago

Though, I am in the more interactive usage camp lately. I do like this behavior.

It would be neat to have some module sanctioned aliases potentially too in the Interactive profile? Or another feature? Considering it appears we have tried to create these types of aliases. The scope of this generation doesn't appear to function correctly though.

https://github.com/dataplat/dbatools/blob/0433f3260cc448b8ca932b8da4a4b777a656768a/dbatools.psm1#L276-L282

Just commenting on these, I would prefer to follow the usage from Get-Verb. So I would rather idq and ccdi.