Reputation: 103733
Specifically, I want to write a powershell script to find every file with extensions.lib & .dll from directory X and all sub-directories of X recursively. Then I want to copy them to directory Y. All files should be put directly in Y, the directory structure of X is not to be copied.
Upvotes: 2
Views: 2363
Reputation: 72650
According that Y exists :
Get-ChildItem -LiteralPath X -filter *.lib -Recurse | % {Copy-Item $_.fullname Y}
Get-ChildItem -LiteralPath X -filter *.dll -Recurse | % {Copy-Item $_.fullname Y}
Upvotes: 6