PowerShell: String Wildcards
Wildcard can be used to represent string patterns.
For example, dir "*jpg"
means list any filename ending in jpg.
?
- Match any character.
*
- Match any character, zero or more times.
[a-z]
- Match a range of characters a to z.
[chars]
- Match any char in chars
- Most command's
Path
parameter value is interpreted as wildcard pattern. e.g.dir *.jpg
lists only files whose name ends in.jpg
. - If you don't want wildcard, use the
LiteralPath
parameter.