Wildcard characters allow you to select elements with similar names in your scripts. For instance, you can use PowerShell wildcards to copy all the objects (lists, subsites, term sets, etc.) with a name that starts or ends with the same word or string of characters.
Details
You can use wildcards with the -Name parameter. -Name is generally used with structural commands like Copy-Site, Copy-List, and Get-TermSet.
You can create a value that will bring all the site objects that start or end with a set of characters with the * symbol.
Type * at the beginning of your string of characters to bring all the objects with a name that ends with that set of characters.
Type * at the end of your string of characters to bring all the objects with a name that starts with that set of characters.
Note: Wildcard support is limited to commands that work with the -Name and -ID parameters. For example, you will find that -Name can be used with Copy-Site in the Parameters section of the Copy Site article.
Examples
Copy subsites with a name that starts with the same set of characters
# Connect to the destination site
$dstSite = Connect-Site -Url "http://myfarm2010/sites/yoursite"
# Connect to the source site
$srcSite = Connect-Site -Url "http://myfarm2013/sites/yoursite"
# Copy sites from the source to the destination with a wildcard for site names starting with "Product"
Copy-Site -Name "Product*" -SourceSite $srcSite -DestinationSite $dstSite
In this example, you will copy all the subsites of the yoursite site collection that start with the name Product. That is, subsites with names like Product A, Product B, and Product C will be migrated.
Copy lists with a name that ends with the same set of characters
# Connect to the source site
$srcSite = Connect-Site -Url "http://myfarm2010/sites/yoursite"
# Connect to the destination site
$dstSite = Connect-Site -Url "http://myfarm2013/sites/yoursite"
# Copy lists from the source site to the destination site
# using a wildcard to match list names ending with "Contracts"
Copy-List -SourceSite $srcSite -Name "*Contracts" -DestinationSite $dstSite
In this example, you will copy all the lists of the yoursite site that ends with the name Contracts. That is, lists with names like Product A Contracts, Product B Contracts, and Product C Contracts will be migrated.