Author Posts

January 14, 2018 at 11:00 am

Hello

I got a question regarding passing pipeline parameters. I have crated a script.

Get-ChildItem -path "C:\Users\karol\Desktop\Migration\Queries" -Recurse -Include "*Run*.sql" | Copy-Item -Destination "C:\Users\karol\Desktop\copyResult"

It worst and is quite easy to understand. My question is about using Copy-Item that way. I used it that way because it was intuitive. I would like to know how to verify it on documentation level that files to be copied can be passed via pipeline.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-5.1

Thanks

January 14, 2018 at 3:52 pm

There's also a really excellent chapter in "Learn Windows PowerShell in a Month of Lunches" that explains the pipeline, and how it works, in great detail.