Invoke-sqmLogging
sqmTool Config
sqmSQLTool v1.8.2+ · Utility
LogPath (see Get-sqmConfig). Writing only happens once the module has finished its own initialization ($script:sqmLoggingReady); calls made before that point are silently skipped rather than failing.
Not under -WhatIf: logging is treated as a side channel and deliberately runs with
-WhatIf:$false internally, so a caller's own -WhatIf never leaks in and turns log writes into no-op "What if: Output to File" noise instead of an actual log entry.Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -Message | string | Required | , | The text to log. |
| -FunctionName | string | Optional | 'General' | Used in the log file name: sqmSQLTool_<yyyyMMdd>_<FunctionName>.log. |
| -Level | string | Optional | 'INFO' | One of: INFO, WARNING, ERROR, DEBUG, VERBOSE. |
Execution Flow
Examples
Write an informational log entry from a custom wrapper script
Invoke-sqmLogging -Message "Nightly job started" -FunctionName "MyWrapper" -Level "INFO"
Write a warning
Invoke-sqmLogging -Message "Backup share almost full" -FunctionName "MyWrapper" -Level "WARNING"