Skip to content

Commit 1f3229b

Browse files
committed
tip: Update example code a bit
1 parent c0c18ca commit 1f3229b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PowerShellTips/2025-03-17-extend-types-with-your-own-properties-and-methods.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ $tip.Example = @'
1313
[scriptblock] $GetValueOrDefaultFunction = {
1414
param($key, $defaultValue)
1515
if ($this.ContainsKey($key)) {
16-
$this[$key]
16+
return $this[$key]
1717
} else {
18-
$defaultValue
18+
return $defaultValue
1919
}
2020
}
2121

0 commit comments

Comments
 (0)