-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathfunctiontemplate.ps1
More file actions
45 lines (43 loc) · 1.04 KB
/
functiontemplate.ps1
File metadata and controls
45 lines (43 loc) · 1.04 KB
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
function Function-Name {
<#
.Synopsis
The short function description.
.Description
The long function description
.Example
C:\PS>Function-Name -param "Param Value"
This example does something
.Example
C:\PS>
You can have multiple examples
.Notes
Name: Function-Name
Author: Author Name
Last Edit: Date
Keywords: Any keywords
.Link
http://foo.com
http://twitter.com/foo
.Inputs
None
.Outputs
None
#Requires -Version 2.0
#>
[CmdletBinding(SupportsShouldProcess=$True)]
Param
(
[Parameter(Mandatory=$true,HelpMessage="Enter a help message")]
[string]$param1,
[Parameter(Mandatory=$false)]
[switch]$param2
)
PROCESS {
if ($pscmdlet.ShouldProcess("Continue?")) {
Write "Doing it..."
}
else {
Write "Not doing it..."
}
}
} #End function