Moving a File or Folder From PowerShell
Please open the Command Prompt by simply by typing powershell into Start Menu search box. Right-click Windows PowerShell and select Run as Administrator. The UAC prompt will ask you for your consent. Click yes, and the prompt will open.

The Move-Item cmdlet command moves an item, including its properties, contents, and child items, from one location to another location. The locations must be supported by the same provider. For example, it can move a file or subdirectory from one directory to another or move a registry subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location.

Let’s take a look at a very simple example: moving a single file from one folder to another. To do that, call Move-Item followed by, in order, the path to the file to be moved and the location to move it to. For example, this command moves the file C:\Scripts\Test.zip to C:\Test:


Code:

Move-Item c:\scripts\test.zip   c:\test



Move-Item accepts wildcards you can easily move all the .zip files in C:\Scripts to C:\Test:


Code:

Move-Item c:\scripts\*.zip  c:\test



By default, Move-Item will not overwrite any existing files in the target folder unless you include the -force parameter, which instructs Move-Item to overwrite existing files.

Following command will move Test.zip to the Test folder, even if the file C:\Test\Test.zip already exists:


Code:

Move-Item c:\scripts\test.zip  c:\test -force


The Move-Item command can also rename the item that is been moved. For example, this command moves the file C:\Scripts\950.log to the C:\Test folder. Note, however, the actual target location: C:\Test\MyLog.log. That means the command will move the file 950.log, and then rename it MyLog.log


Code:

Move-Item c:\scripts\950.log  c:\test\mylog.log



Move registry keys and values:

Code:

 Move-Item hklm:\software\SS64\* hklm:\software\TEST


The wildcard (*) indicates that the contents of the SS64 key should be moved, but not the key itself.

Move-Item Aliases:

mi

mv

move