Skip to content

Commit 6195f16

Browse files
committed
Update AvoidTrapStatement.md
1 parent e97d904 commit 6195f16

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

RuleDocumentation/AvoidTrapStatement.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ To fix a violation of this rule, please remove Trap statements and use try-catch
1313
##Example
1414

1515
Wrong:
16-
16+
```
1717
function TrapTest
1818
{
1919
trap {"Error found: $_"}
2020
}
21-
21+
```
2222
Correct:
23-
23+
```
2424
function TrapTest
2525
{
2626
try
2727
{
2828
$a = New-Object "dafdf"
29-
$a | get-member
29+
$a | Get-Member
3030
}
3131
catch [System.Exception]
3232
{
@@ -36,4 +36,5 @@ Correct:
3636
{
3737
"End the script"
3838
}
39-
}
39+
}
40+
```

0 commit comments

Comments
 (0)