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.) that have a name that starts or ends with the same word or string of characters.
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.
Copy subsites with a name that starts with the same set of characters
$dstSite = Connect-Site http://myfarm2010/sites/sharegate
$srcSite = Connect-Site http://myfarm2013/sites/sharegate
Copy-Site Product* $srcSite $dstSite
In this example, you would be copying all the subsites of the sharegate site collection that start with the name Product.
For instance, subsites with names like Product ShareGate Desktop, Product ShareGate Apricot, and Product ShareGate Overcast would get migrated.
Copy lists with a name that ends with the same set of characters
$srcSite = Connect-Site http://myfarm2010/sites/sharegate
$dstSite = Connect-Site http://myfarm2013/sites/sharegate
Copy-List $srcSite *Contracts $dstSite
In this example, you would be copying all the lists of the sharegate site that ends with the name Contracts.
For instance, lists with names like ShareGate Desktop Contracts, ShareGate Apricot Contracts, and ShareGate Overcast Contracts would get migrated.