> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# powershell/PSDSCUseVerboseMessageInDSCResource

> Use verbose message in DSC resource

`powershell/PSDSCUseVerboseMessageInDSCResource` is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.

| Property | Value             |
| -------- | ----------------- |
| Severity | Information       |
| Category | PSScriptAnalyzer  |
| Default  | Disabled in tally |
| Auto-fix | No                |

<Note>
  tally disables this rule by default because Desired State Configuration resources are out
  of scope for Dockerfile `RUN` analysis. Re-enable it with
  `include = ["powershell/PSDSCUseVerboseMessageInDSCResource"]` or by setting
  `rules.powershell.PSDSCUseVerboseMessageInDSCResource.severity = "warning"` in `.tally.toml`.
</Note>

## Description

Best practice recommends that additional user information is provided within commands, functions and
scripts using `Write-Verbose`.

## How

Make use of the `Write-Verbose` command.

## Examples

### Problematic code

```powershell theme={null}
Function Test-Function
{
    [CmdletBinding()]
    Param()
    ...
}
```

### Correct code

```powershell theme={null}
Function Test-Function
{
    [CmdletBinding()]
    Param()
    Write-Verbose 'Verbose output'
    ...
}
```

## Source

This rule documentation is adapted from Microsoft's PSScriptAnalyzer documentation for
[DSCUseVerboseMessageInDSCResource](https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/blob/main/reference/docs-conceptual/PSScriptAnalyzer/Rules/DSCUseVerboseMessageInDSCResource.md),
licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
