Get-sqmConfig
Configuration
sqmSQLTool v1.8.2+ · Utility
-Key, returns the value of a specific configuration key (e.g., OutputPath, LogPath, CentralPath). If a key doesn't exist, a warning is issued and $null is returned.
Configuration is initialized once when the module loads and stored in
$script:sqmModuleConfig.
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -Key | string | Optional | — | Name of a specific configuration key. If not provided, entire hashtable is returned. |
Usage
Return Value: Hashtable (all config) or scalar value (single key).
Non-existent key: Warning message listing available keys + returns $null.
Common configuration keys include: LogPath, OutputPath, CentralPath, DefaultSqlCredential, and others set during module initialization in sqmSQLTool.psm1.
Examples
View entire module configuration
Get-sqmConfig
Get a specific configuration value
$outputPath = Get-sqmConfig -Key 'OutputPath'
Retrieve CentralPath configuration key
Get-sqmConfig -Key 'CentralPath'