Skip to content

Commit 7eb69c2

Browse files
Recommend WildcardPattern::ContainsWildcardCharacters over String.Contains for wildcard detection
1 parent 67b2120 commit 7eb69c2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

docs/Agents/Standards/PowerShell-Module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Layout rules:
8787
- Respect caller preferences — don't force `-Verbose:$true` inside the module.
8888
- Use `try` / `catch` only when adding value (translation, enrichment, cleanup).
8989
- String emptiness: `-not $Param`, never `[string]::IsNullOrEmpty(...)`.
90+
- Wildcard detection: `[System.Management.Automation.WildcardPattern]::ContainsWildcardCharacters($Value)`, never `$Value.Contains('*')`. The latter misses `?`, `[`, and `` ` `` — all valid PowerShell wildcard characters.
9091

9192
## Public function structure
9293

0 commit comments

Comments
 (0)