Skip to main content

Command referenceMove-Item

Move-Item command (Windows / PowerShell)

WindowsPowerShellfilebeginner

What it does

Move or rename items in filesystem and other providers. Guides covering the move-item powershell usually need pipeline-friendly examples, common parameters, and how the cmdlet compares with classic CMD or Linux tools. This page includes syntax, options, and copyable PowerShell examples.

Move or rename items in filesystem and other providers.

Syntax

Move-Item [-Path] <String[]> [[-Destination] <String>] [-Force] [-PassThru]

Common options

Flag / optionMeaning
-DestinationSet the new parent path or item name.
-ForceMove items that cannot otherwise be changed.
-LiteralPathUse a path without wildcard expansion.
-PassThruReturn the moved item.

Practical examples

Rename file

Move-Item draft.txt final.txt

Renames the file in its current directory.

Move logs

Move-Item .\*.log D:\Logs\Archive\

Moves matching logs.

Return result

Move-Item report.csv D:\Reports -PassThru

Moves and emits the resulting item.

Linux ↔ Windows equivalent

Closest match: mv (Linux / bash / sh / zsh). Move or rename files and directories.

Common mistakes

  • Assuming moving a directory into an existing directory always merges contents.
  • Using a wildcard source without reviewing all matches.

FAQ

What does Move-Item do in PowerShell?

Move or rename items in filesystem and other providers.

How can I see examples for Move-Item?

Run `Get-Help Move-Item -Examples`, then adapt an example to the provider and objects you are using.

What is a practical Move-Item example?

Try `Move-Item draft.txt final.txt` — Renames the file in its current directory.

Does Move-Item return text or objects?

Move-Item normally participates in PowerShell's object pipeline; formatting seen in the console is a view of those objects.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.