Tuesday, August 4, 2015

The Basics: Copy Files Using Powershell

Copying files using Powershell may seem unnecessary, however it's important to understand this basic functionality and apply these concepts to more advanced methods. On top of that, no sys admin should be copying files using explorers clunky copy/paste method. The copy-item commandlet offers a powerful and fast way to copy files. In the example below, I demonstrate how to copy a single file, multiple files recursively, and specific file extensions.

Copy Single File

Copy-Item c:\source\file.pdf c:\destination

Copy Multiple Files Recursively

Copy-Item c:\source d:\destination -recurse

Copy Only PDF Files

Copy-Item c:\source\*.pdf c:\destination

No comments:

Post a Comment