Skip to content

Commit fe4ed57

Browse files
Fix Verbose test description and add CmdletBinding to helper functions in example
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
1 parent 13e2035 commit fe4ed57

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ These tests run against your source code files in the `src` directory:
471471
| Test ID | Description | Example Skip Comment |
472472
|---------|-------------|---------------------|
473473
| `NumberOfProcessors` | Enforces use of `[System.Environment]::ProcessorCount` instead of `$env:NUMBER_OF_PROCESSORS` | `#SkipTest:NumberOfProcessors:Legacy code compatibility required` |
474-
| `Verbose` | Prevents use of `-Verbose` parameter in code (should only be used with `:$false` qualifier to explicitly disable) | `#SkipTest:Verbose:Required for debugging output` |
474+
| `Verbose` | Ensures code does not pass `-Verbose` to other commands (which would override user preference), unless explicitly disabled with `-Verbose:$false` | `#SkipTest:Verbose:Required for debugging output` |
475475
| `OutNull` | Enforces use of `$null = ...` instead of `... \| Out-Null` for better performance | `#SkipTest:OutNull:Pipeline processing required` |
476476
| `NoTernary` | Prohibits ternary operators for PowerShell 5.1 compatibility (this test is skipped by default in the framework) | `#SkipTest:NoTernary:PowerShell 7+ only module` |
477477
| `LowercaseKeywords` | Ensures all PowerShell keywords are lowercase | `#SkipTest:LowercaseKeywords:Generated code` |
@@ -514,12 +514,20 @@ function Get-ComplexData {
514514
}
515515
516516
function Get-RawData {
517-
param([string]$Path)
517+
[CmdletBinding()]
518+
param(
519+
[Parameter(Mandatory)]
520+
[string] $Path
521+
)
518522
# Helper function implementation
519523
}
520524
521525
function Format-ComplexData {
522-
param($Data)
526+
[CmdletBinding()]
527+
param(
528+
[Parameter(Mandatory)]
529+
$Data
530+
)
523531
# Helper function implementation
524532
}
525533
```

0 commit comments

Comments
 (0)