Skip to content

Commit 4bcde99

Browse files
Update PowerShellScriptParameters.md
1 parent f944156 commit 4bcde99

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Snippets/PowerShellScriptParameters.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param
88
[Parameter(Mandatory = $true,
99
Position = 1,
1010
HelpMessage = 'Please specify a valid Windows folder path')]
11-
[ValidatePattern('^([a-zA-Z]:\\)([^\\/:*?<>"|]+\\)*[^\\/:*?<>"|\s]+$')] # regex pattern to ensure the end user provides a folder path matching common Windows folder path convention
11+
[ValidatePattern('^([a-zA-Z]:\\)([^\\/:*?<>"|]+\\)*[^\\/:*?<>"|\s]+$')]
1212
[String]$path,
1313
[Parameter(Mandatory = $true,
1414
Position = 2,
@@ -23,7 +23,8 @@ param
2323
[Parameter(Position = 4,
2424
HelpMessage = 'This parameter is looking for only a positive integer')]
2525
[ValidateRange("Positive")]
26-
[int]$PositiveNumberOnly
26+
[int]$PositiveNumberOnly,
27+
[string]$NotMandatoryOrPositional # This parameter is not mandatory or positional, compared to the rest of the parameters
2728
)
2829
```
2930

0 commit comments

Comments
 (0)