Skip to content

Files

Latest commit

 

History

History
38 lines (27 loc) · 786 Bytes

DSCUseVerboseMessageInDSCResource.md

File metadata and controls

38 lines (27 loc) · 786 Bytes

Pattern: Missing use of Write-Verbose in DSC function

Issue: -

Description

It is a best practice to emit informative, verbose messages in DSC resource functions. This helps in debugging issues when a DSC configuration is executed.

How

Make use of the Write-Verbose command.

Example of incorrect code:

Function Test-Function
{
    [CmdletBinding()]
    Param()
    ...
}

Example of correct code:

Function Test-Function
{
    [CmdletBinding()]
    Param()
    Write-Verbose "Verbose output"
    ...
}

Further Reading