How to Copy and Rename Files in PowerShell

To copy and rename a file in PowerShell, you don’t need two commands. Give Copy-Item the new file name as the -Destination, and it copies and renames in one step:

Copy-Item -Path .\Reports\Budget-2026.xlsx -Destination .\Backup\Budget-2026-Final.xlsx

The original stays where it was. Below I’ll cover overwrites, missing folders, bulk renames, dates, counters and the spots where PowerShell 7 and Windows PowerShell 5.1 behave differently.

Set up a practice folder for copying and renaming files

I’d rather you try these commands on throwaway files than on your real reports. Open PowerShell 7 (pwsh) or Windows PowerShell from the Start menu, paste this script and press Enter:

$root = 'C:\psfaqs\t\copyrename'
$null = New-Item "$root\Reports\Q3", "$root\Backup" -ItemType Directory -Force
'Region,Revenue'    | Set-Content "$root\Reports\Q3-Sales-Report.csv"
'Vendor,City,State' | Set-Content "$root\Reports\Vendor-List.csv"
'Item,Amount'       | Set-Content "$root\Reports\Budget-2026.xlsx"
'Category,Amount'   | Set-Content "$root\Reports\Expenses.xls"
'Invoice 1042'      | Set-Content "$root\Reports\Invoice-1042.pdf"
'Draft'             | Set-Content -LiteralPath "$root\Reports\Invoice [Draft].docx"
'Q3 notes'          | Set-Content "$root\Reports\Q3\Notes.txt"

Get-ChildItem "$root\Reports" -Recurse -File | ForEach-Object { $_.FullName.Substring($root.Length + 1) }

Output:

Reports\Budget-2026.xlsx
Reports\Expenses.xls
Reports\Invoice [Draft].docx
Reports\Invoice-1042.pdf
Reports\Q3-Sales-Report.csv
Reports\Vendor-List.csv
Reports\Q3\Notes.txt

That gives you a Reports folder with a few US business files, a Q3 subfolder and an empty Backup folder. Change $root to any folder you like; every example below uses the same layout.

For the full parameter list, including remote copies over a PSSession, see my complete Copy-Item guide. This post stays on one job: making the copy land under a new name.

Copy a file and rename it with Copy-Item -Destination

When the -Destination value ends in a file name, Copy-Item uses that name for the copy. Copy-Item is silent by default, so add -PassThru to get the new file back as an object:

$source = 'C:\psfaqs\t\copyrename\Reports\Q3-Sales-Report.csv'
$target = 'C:\psfaqs\t\copyrename\Backup\Q3-Sales-Report-Final.csv'

Copy-Item -Path $source -Destination $target -PassThru |
    Format-List Name, Length, DirectoryName

Output:

Name          : Q3-Sales-Report-Final.csv
Length        : 16
DirectoryName : C:\psfaqs\t\copyrename\Backup
PowerShell Copy-Item copying a file to a new name with -PassThru
Copy-Item -Destination with a new file name, and -PassThru returning the renamed copy (PowerShell 7)

Name shows the new file name, and Length proves the content came along. If -Destination points to an existing folder instead, the file keeps its old name inside that folder.

That’s the one rule to remember. A folder path keeps the name, while a full file path renames the copy.

Does