recent
أخبار ساخنة

How to Copy files using PowerShell

Home
How to Copy files using PowerShell


This section is about cmdlets that are installed with the PowerShell module in Microsoft PowerShell Management.
Contains cmdlets that help you manage Windows in PowerShell.


Copy-Item


The Copy-Item command copies an item from one location to another.
For example it can copy a file to a folder.

This command can copy and rename existing items.

Examples of Copy-Item

Example 1:

Copy a file to the specified folder

This example copies the file mar1604.log.txt to the folder C:\Presentation
The original file is not deleted.

Copy-Item "C:\Wabash\Logfiles\mar1604.log.txt" -Destination "C:\Presentation"



Example 2

This example copies the contents of the C:\Logfiles folder to the C:\Drawings folder.
  The Logfiles folder is not copied.


Copy-Item -Path "C:\Logfiles\*" -Destination "C:\Drawings" -Recurse


Example 3
 
Copy the folder and contents to a new folder


Copy-Item -Path "C:\Logfiles" -Destination "C:\Drawings\Logs" -Recurse 
google-playkhamsatmostaqltradent