Skip to content

Commit fd6c8a9

Browse files
committed
Complete example.
1 parent 7c6107d commit fd6c8a9

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Snippets/Test-Obsolete.ps1

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function Test-Obsolete {
2+
<#
3+
.SYNOPSIS
4+
Test an obsolete parameter.
5+
6+
.DESCRIPTION
7+
Test an obsolete parameter.
8+
9+
.EXAMPLE
10+
Test-Obsolete -Mode 0
11+
12+
This example shows how to use the obsolete parameter. The Mode parameter is deprecated and will be removed in a future version.
13+
14+
.NOTES
15+
Author: Sam Erde
16+
Version: 0.0.1
17+
Modified: 2025-02-12
18+
#>
19+
20+
[CmdletBinding()]
21+
22+
param (
23+
# Test something
24+
[Parameter()]
25+
[Obsolete("Mode is being replaced by the more flexible 'Scans', 'OutputType', and 'IncludeFixes' parameters, and will be removed in a future version. Use 'Get-Help Test-Obsolete -Full' for more information.")]
26+
[int16]
27+
$Mode = 0
28+
)
29+
30+
begin {
31+
32+
} # end begin block
33+
34+
process {
35+
Write-Output "You chose mode ${Mode}."
36+
} # end process block
37+
38+
end {
39+
40+
} # end end block
41+
42+
} # end function Test-Function

0 commit comments

Comments
 (0)