commands

^

Get-DbatoolsConfigValue

Author Friedrich Weinmann (@FredWeinmann)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbatoolsConfigValue on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbatoolsConfigValue.

Synopsis

Returns the configuration value stored under the specified name.

Description

Returns the configuration value stored under the specified name. It requires the full name (.) and is usually only called by functions.

Syntax

Get-DbatoolsConfigValue
    [-FullName] <String>
    [[-Fallback] <Object>]
    [-NotNull]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbatoolsConfigValue -Name 'System.MailServer'

Returns the configured value that was assigned to the key 'System.MailServer'

Example: 2
PS C:\> Get-DbatoolsConfigValue -Name 'Default.CoffeeMilk' -Fallback 0

Returns the configured value for 'Default.CoffeeMilk'. If no such value is configured, it returns '0' instead.

Required Parameters

-FullName

The full name (.) of the configured value to return.

Alias Name
Required True
Pipeline false
Default Value

Optional Parameters

-Fallback

A fallback value to use, if no value was registered to a specific configuration element. This basically is a default value that only applies on a "per call" basis, rather than a system-wide default.

Alias
Required False
Pipeline false
Default Value
-NotNull

By default, this function returns null if one tries to retrieve the value from either a Configuration that does not exist or a Configuration whose value was set to null. However, sometimes it may be important that some value was returned. By specifying this parameter, the function will throw an error if no value was found at all.

Alias
Required False
Pipeline false
Default Value False