![]() We can use the Copy-Item cmdlet also to copy a complete folder to a new location. # Copy ad01-log-1.txt and ad01-log-2.txtĬopy-Item -Path C:\temp\files\ad01-log-1.txt,C:\temp\files\ad01-log-2.txt -Destination d:\temp\ PowerShell Copy Folder ![]() For the destination, you will need to use a folder. To do this you will need to separate each file with a comma. To copy multiple files with PowerShell, you can either use filters, which I will explain later in the article, or select multiple files in the path. This is also one of the useful features of the Copy-Item cmdlet, we can specify a new name for the file on the destination: # Copy and rename the file:Ĭopy-Item -Path "C:\temp\files\la-ams-ad01-log-2.txt" -Destination "d:\temp\logfile.txt" Copy Multiple Files Keep in mind that you will need to end the destination folder name with a \, otherwise, you will rename the file. When you want to copy a single file you will need to specify the source path and the destination folder: Copy-Item -Path "C:\temp\files\la-ams-ad01-log-1.txt" -Destination "d:\temp\"Ĭopy "C:\temp\files\la-ams-ad01-log-1.txt" "d:\temp\" ![]() Let’s start with the basics when it comes to copying files with PowerShell. In this article, we are going to take a look at different examples of how to copy a file with PowerShell. ![]() Copy File to Remote Computer with PowerShell.Copy and Merge Multiple Folders at Once. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |