Wildcards are used to select strings (or «items») that meet a certain pattern.
No default expansion in most commands
Note that
PowerShell won't expand wildcards when invoking a
command as one might be used from other shells. The following command wll print the literal string
*.ps1
, regardless if there are any
PowerShell scripts in the current directory:
write-output *.ps1
There are, however, a few comannds that do expand wild cards.
These commands can be forced to not expand wildcards by using the
-literalPath
option, for example in the cmdlet
remove-item
.