@@ -107,8 +107,117 @@ function Get-File
107
107
}
108
108
}
109
109
110
+ <#
111
+ . Synopsis
112
+ Short description
113
+ . DESCRIPTION
114
+ Long description
115
+ . EXAMPLE
116
+ Example of how to use this cmdlet
117
+ . EXAMPLE
118
+ Another example of how to use this cmdlet
119
+ . INPUTS
120
+ Inputs to this cmdlet (if any)
121
+ . OUTPUTS
122
+ Output from this cmdlet (if any)
123
+ . NOTES
124
+ General notes
125
+ . COMPONENT
126
+ The component this cmdlet belongs to
127
+ . ROLE
128
+ The role this cmdlet belongs to
129
+ . FUNCTIONALITY
130
+ The functionality that best describes this cmdlet
131
+ #>
132
+ function Get-Folder
133
+ {
134
+ [CmdletBinding (DefaultParameterSetName = ' Parameter Set 1' ,
135
+ SupportsShouldProcess ,
136
+ PositionalBinding = $false ,
137
+ HelpUri = ' http://www.microsoft.com/' ,
138
+ ConfirmImpact = ' Medium' )]
139
+ [Alias ()]
140
+ [OutputType ([String ], [System.Double ], [Hashtable ], " MyCustom.OutputType" )]
141
+ [OutputType (" System.Int32" , ParameterSetName = " ID" )]
142
+
143
+ Param
144
+ (
145
+ # Param1 help description
146
+ [Parameter (Mandatory = $true ,
147
+ ValueFromPipeline = $true ,
148
+ ValueFromPipelineByPropertyName = $true ,
149
+ ValueFromRemainingArguments = $false ,
150
+ Position = 0 ,
151
+ ParameterSetName = ' Parameter Set 1' )]
152
+ [ValidateNotNull ()]
153
+ [ValidateNotNullOrEmpty ()]
154
+ [ValidateCount (0 , 5 )]
155
+ [ValidateSet (" sun" , " moon" , " earth" )]
156
+ [Alias (" p1" )]
157
+ $Param1 ,
158
+
159
+ # Param2 help description
160
+ [Parameter (ParameterSetName = ' Parameter Set 1' )]
161
+ [AllowNull ()]
162
+ [AllowEmptyCollection ()]
163
+ [AllowEmptyString ()]
164
+ [ValidateScript ({$true })]
165
+ [ValidateRange (0 , 5 )]
166
+ [int ]
167
+ $Param2 ,
168
+
169
+ # Param3 help description
170
+ [Parameter (ParameterSetName = ' Another Parameter Set' )]
171
+ [ValidatePattern (" [a-z]*" )]
172
+ [ValidateLength (0 , 15 )]
173
+ [String ]
174
+ $Param3 ,
175
+ [bool ]
176
+ $Force
177
+ )
178
+
179
+ Begin
180
+ {
181
+ }
182
+ Process
183
+ {
184
+ if ($pscmdlet.ShouldProcess (" Target" , " Operation" ))
185
+ {
186
+ Write-Verbose " Write Verbose"
187
+ Get-Process
188
+ }
189
+
190
+ $a = 4.5
191
+
192
+ if ($true )
193
+ {
194
+ $a
195
+ }
196
+
197
+ $a | Write-Warning
198
+
199
+ $b = @ {" hash" = " table" }
200
+
201
+ Write-Debug @b
202
+
203
+ [pscustomobject ]@ {
204
+ PSTypeName = ' MyCustom.OutputType'
205
+ Prop1 = ' SomeValue'
206
+ Prop2 = ' OtherValue'
207
+ }
208
+
209
+ return @ {" hash" = " true" }
210
+ }
211
+ End
212
+ {
213
+ if ($pscmdlet.ShouldContinue (" Yes" , " No" )) {
214
+ }
215
+ [System.Void ] $Param3
216
+ }
217
+ }
218
+
110
219
# Write-Verbose should not be required because this is not an advanced function
111
- function Get-SimpleFunc
220
+ function global : Get-SimpleFunc
112
221
{
113
222
114
223
}
0 commit comments