I have the following snippet of PowerShell script:
$source = \'d:\\t1\\*\' $dest = \'d:\\t2\' $exclude = @(\'*.pdb\',\'*.config\') Copy-Item $source $dest -R
The below snippet will copy all files and folders from $source to $dest, excluding .pdb and .config files from the root folder and sub-folders:
$source
$dest
.pdb
.config
Get-ChildItem -Path $source | Copy-Item -Destination $dest -Recurse -Container -Exclude @('*.pdb','*.config')