File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
reference/5.1/Microsoft.PowerShell.Core/About Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11---
2- ms.date : 2017-12-01
2+ ms.date : 2017-12-06
33schema : 2.0.0
44locale : en-us
55keywords : powershell,cmdlet
@@ -167,9 +167,9 @@ Switch has the following parameters:
167167| | condition. Wildcard and Exact are ignored. Also, if the |
168168| | match clause is not a string, this parameter is ignored. |
169169
170+ In this example, there is no matching case so there is no output.
170171
171172``` powershell
172- Example:
173173 PS> switch ("fourteen")
174174 {
175175 1 {"It is one."; Break}
@@ -179,7 +179,12 @@ Example:
179179 3 {"Three again."; Break}
180180 "fo*" {"That's too many."}
181181 }
182+ ```
183+
184+ For the word "fourteen" to match a case you must use the ** -Wildcard** or
185+ ** -Regex** parameter.
182186
187+ ``` powershell
183188 PS> switch -Regex ("fourteen")
184189 {
185190 1 {"It is one."; Break}
@@ -189,6 +194,11 @@ Example:
189194 3 {"Three again."; Break}
190195 "fo*" {"That's too many."}
191196 }
197+ ```
198+
199+ Result:
200+
201+ ``` Output
192202That's too many.
193203```
194204
You can’t perform that action at this time.
0 commit comments