Skip to content

Commit f53cc38

Browse files
iRon7sdwheeler
andauthored
Update docs/Rules/MissingTryBlock.md
Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
1 parent a420820 commit f53cc38

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

docs/Rules/MissingTryBlock.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ title: MissingTryBlock
1010

1111
## Description
1212

13-
The `catch` and `finally` blocks should be preceded by a `try` block.
14-
Otherwise, the `catch` and `finally` blocks will be interpreted as commands, which is likely a mistake and
15-
will result in a "*The term 'catch' is not recognized as a name of a cmdlet*" error at runtime.
13+
The `catch` and `finally` blocks must be preceded by a `try` block. Without a `try` block, the
14+
`catch` and `finally` are interpreted as commands and result in a runtime error, such as:
15+
16+
> "The term 'catch' is not recognized as a name of a cmdlet"
17+
18+
This rule identifies instances where `catch` or `finally` blocks are present with out an associated
19+
`try` block.
1620

1721
## How
1822

0 commit comments

Comments
 (0)