forked from Abhisheksinha1506/Collection-of-Useful-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDefine-Custom-Help.ps1
111 lines (82 loc) · 2.15 KB
/
Define-Custom-Help.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Basic Function
function Add-FourNumbers()
{
param(
[Int32]$first,
[Int32]$second,
[Int32]$third,
[Int32]$fourth
)
$result = $first + $second + $third + $fourth
Write-Host "$($first) + $($second) + $($third) + $($fourth) = $($result)"
}
Add-FourNumbers -first 1 -second 1 -third 1 -fourth 1
# Basic Function with Parameter Help
function Add-FourNumbers()
{
param(
[Int32]
# Specifies the first number
$first,
[Int32]
# Specifies the second number
$second,
[Int32]
# Specifies the third number
$third,
[Int32]
# Specifies the fourth number
$fourth
)
$result = $first + $second + $third + $fourth
Write-Host "$($first) + $($second) + $($third) + $($fourth) = $($result)"
}
# Basic Function with Detailed Help
function Add-FourNumbers()
{
param(
[Int32]$first,
[Int32]$second,
[Int32]$third,
[Int32]$fourth
)
$result = $first + $second + $third + $fourth
Write-Host "Here is the full sum"
Write-Host "$($first) + $($second) + $($third) + $($fourth) = $($result)"
<#
.SYNOPSIS
Adds four numbers together and returns the result.
.DESCRIPTION
Adds four numbers together and returns the result.
Takes any four numbers.
.PARAMETER first
Specifies the first number
.PARAMETER second
Specifies the second number
.PARAMETER third
Specifies the third number
.PARAMETER fourth
Specifies the fourth number
.INPUTS
None
.OUTPUTS
System.String
.EXAMPLE
C:\PS> Add-FourNumbers -first 1 -second 2 -third 3 -fourth 4
Here is the full sum
1 + 2 + 3 + 4 = 10
#>
}
Get-Help Add-FourNumbers
# Script Level Help
<#
.SYNOPSIS
This is a custom script.
.DESCRIPTION
This script contains all the functions needed.
.INPUTS
None
.OUTPUTS
System.String
#>
Get-Help .\Help.ps1