< Back

Get-DbatoolsConfigValue

Mon Jan 13, 2020 11:44 am

NAME Get-DbatoolsConfigValue



SYNOPSIS

Returns the configuration value stored under the specified name.





SYNTAX

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





DESCRIPTION

Returns the configuration value stored under the specified name.



It requires the full name (<Module>.<Name>) and is usually only called by functions.





PARAMETERS

-Fallback [<System.Object>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-FullName [<String>]

The full name (<Module>.<Name>) of the configured value to return.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-NotNull [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Module

Author: Friedrich Weinmann (@FredWeinmann)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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.



RELATED LINKS