PoshTip #17 – Copy files to a new location

PoshTip #17 – Copy files to a new location

To copy a file from one folder to another, you can use the Copy-Item cmdlet :

You can copy and rename the file with the same cmdlet :

You can test if the destination folder exist with Test-Path cmdlet :

About Nicolas 248 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 8 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.