|
267 | 267 | "\tThe functionality that best describes this cmdlet",
|
268 | 268 | "\t#>",
|
269 | 269 | "\t[CmdletBinding(DefaultParameterSetName = 'Parameter Set 1',",
|
270 |
| - "\t\tSupportsShouldProcess = $true,", |
271 |
| - "\t\tPositionalBinding = $false,", |
| 270 | + "\t\tSupportsShouldProcess = \\$true,", |
| 271 | + "\t\tPositionalBinding = \\$false,", |
272 | 272 | "\t\tHelpUri = 'http://www.microsoft.com/',",
|
273 | 273 | "\t\tConfirmImpact = 'Medium')]",
|
274 | 274 | "\t[Alias()]",
|
275 | 275 | "\t[OutputType([String])]",
|
276 | 276 | "\tparam (",
|
277 | 277 | "\t\t# Param1 help description",
|
278 |
| - "\t\t[Parameter(Mandatory = $true,", |
279 |
| - "\t\t\tValueFromPipeline = $true,", |
280 |
| - "\t\t\tValueFromPipelineByPropertyName = $true,", |
281 |
| - "\t\t\tValueFromRemainingArguments = $false,", |
| 278 | + "\t\t[Parameter(Mandatory = \\$true,", |
| 279 | + "\t\t\tValueFromPipeline = \\$true,", |
| 280 | + "\t\t\tValueFromPipelineByPropertyName = \\$true,", |
| 281 | + "\t\t\tValueFromRemainingArguments = \\$false,", |
282 | 282 | "\t\t\tPosition = 0,",
|
283 | 283 | "\t\t\tParameterSetName = 'Parameter Set 1')]",
|
284 | 284 | "\t\t[ValidateNotNull()]",
|
285 | 285 | "\t\t[ValidateNotNullOrEmpty()]",
|
286 | 286 | "\t\t[ValidateCount(0, 5)]",
|
287 | 287 | "\t\t[ValidateSet(\"sun\", \"moon\", \"earth\")]",
|
288 | 288 | "\t\t[Alias(\"p1\")]",
|
289 |
| - "\t\t$Param1,", |
| 289 | + "\t\t\\$Param1,", |
290 | 290 | "",
|
291 | 291 | "\t\t# Param2 help description",
|
292 | 292 | "\t\t[Parameter(ParameterSetName = 'Parameter Set 1')]",
|
293 | 293 | "\t\t[AllowNull()]",
|
294 | 294 | "\t\t[AllowEmptyCollection()]",
|
295 | 295 | "\t\t[AllowEmptyString()]",
|
296 |
| - "\t\t[ValidateScript({ $true })]", |
| 296 | + "\t\t[ValidateScript({ \\$true })]", |
297 | 297 | "\t\t[ValidateRange(0, 5)]",
|
298 | 298 | "\t\t[int]",
|
299 |
| - "\t\t$Param2,", |
| 299 | + "\t\t\\$Param2,", |
300 | 300 | "",
|
301 | 301 | "\t\t# Param3 help description",
|
302 | 302 | "\t\t[Parameter(ParameterSetName = 'Another Parameter Set')]",
|
303 | 303 | "\t\t[ValidatePattern(\"[a-z]*\")]",
|
304 | 304 | "\t\t[ValidateLength(0, 15)]",
|
305 | 305 | "\t\t[String]",
|
306 |
| - "\t\t$Param3", |
| 306 | + "\t\t\\$Param3", |
307 | 307 | "\t)",
|
308 | 308 | "",
|
309 | 309 | "\tbegin {",
|
310 | 310 | "\t\t#BeginCodeHere",
|
311 | 311 | "\t}",
|
312 | 312 | "",
|
313 | 313 | "\tprocess {",
|
314 |
| - "\t\tif ($pscmdlet.ShouldProcess(\"Target\", \"Operation\")) {", |
| 314 | + "\t\tif (\\$pscmdlet.ShouldProcess(\"Target\", \"Operation\")) {", |
315 | 315 | "\t\t\t#ProcessCodeHere",
|
316 | 316 | "\t\t}",
|
317 | 317 | "\t}",
|
|
0 commit comments