.DESCRIPTION
This function acts as central information node for dbatools.
Other functions hand off all their information output for processing to this function.

This function will then handle:
- Warning output
- Error management for non-terminating errors (For errors that terminate execution or continue on with the next object use "Stop-Function")
- Logging
- Verbose output
- Message output to users

At what complexity what path for the information is chosen is determined by the configuration settings:
message.maximuminfo
message.maximumverbose
message.maximumdebug
message.minimuminfo
message.minimumverbose
message.minimumdebug
Which can be set to any level from 1 through 9
Depending on the configuration it is very possible to have multiple paths chosen simultaneously

.PARAMETER Message
The message to write/log. The function name and timestamp will automatically be prepended.

.PARAMETER Level
This parameter represents the verbosity of the message. The lower the number, the more important it is for a human user to read the message.
By default, the levels are distributed like this:
- 1-3 Direct verbose output to the user (using Write-Host)
- 4-6 Output only visible when requesting extra verbosity (using Write-Verbose)
- 1-9 Debugging information, written using Write-Debug
The specific level of verbosity preference can be configured using the settings of the message.maximum and message.minimum namespace.

In addition, it is possible to select the level "Warning" which moves the message out of the configurable range:
The user will always be shown this message, unless he silences the entire thing with -EnableException

Possible levels:
Critical (1), Important / Output (2), Significant (3), VeryVerbose (4), Verbose (5), SomewhatVerbose (6), System (7), Debug (8), InternalComment (9), Warning (666)
Either one of the strings or its respective number will do as input.

.PARAMETER EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

.PARAMETER FunctionName
The name of the calling function.
Will be automatically set, but can be overridden when necessary.

.PARAMETER ErrorRecord
If an error record should be noted with the message, add the full record here.
Especially designed for use with Warning-mode, it can legally be used in either mode.
The error will be added to the $Error variable and enqued in the dbatools debugging system.

.PARAMETER Warning
Deprecated, do not use anymore

.PARAMETER Once
Setting this parameter will cause this function to write the message only once per session.
The string passed here and the calling function's name are used to create a unique ID, which is then used to register the action in the configuration system.
Thus will the lockout only be written if called once and not burden the system unduly.
This lockout will be written as a hidden value, to see it use Get-DbaConfig -Force.

.PARAMETER OverrideExceptionMessage
Disables automatic appending of exception messages.
Use in cases where you already have a speaking message interpretation and do not need the original message.

.PARAMETER Target
If an ErrorRecord was passed, it is possible to add the object on which the error occurred, in order to simplify debugging / troubleshooting.

Writes the message 'Connecting to Database1'. By default, this will be
- Written to the in-memory message log
- Written to the logfile
- Written to the Verbose stream (Write-Verbose)
- Written to the Debug stream (Write-Debug)

Writes the message "Connecting to Database 2 failed". By default, this will be
- Written to the in-memory message log
- Written to the in-memory error queue
- Written to the $error variable
- Written to the logfile
- Written to the error log files
- Written to the Warning stream (Write-Warning, not if silent)
- Written to the Debug stream (Write-Debug)

# Since it's internal, I set it to always silent. Will show up in tests, but not bother the end users with a reminder over something they didn't do.Test-DbaDeprecation-DeprecatedOn"1.0.0"-Parameter"Warning"-CustomMessage"The parameter -Warning has been deprecated and will be removed on release 1.0.0. Please use '-Level Warning' instead."-EnableException$true