Skip to content

Commit fbdebe3

Browse files
(AB-538639) Add note for destination exists to Move-Item
1 parent 4dde946 commit fbdebe3

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

reference/5.1/Microsoft.PowerShell.Management/Move-Item.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 02/26/2024
5+
ms.date: 04/01/2026
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or
4444
subkey from one key to another. When you move an item, it is added to the new location and deleted
4545
from its original location.
4646

47+
If the specified destination path resolves to an existing non-container item, or you're renaming
48+
and an item with the target name already exists, this cmdlet raises an error. To overwrite an
49+
existing item in these cases, specify the **Force** parameter. When the destination is an existing
50+
container (such as a directory), the item is moved into that container, if supported by the
51+
provider.
52+
4753
## EXAMPLES
4854

4955
### Example 1: Move a file to another directory and rename it

reference/7.4/Microsoft.PowerShell.Management/Move-Item.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 02/26/2024
5+
ms.date: 04/01/2026
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or
4444
subkey from one key to another. When you move an item, it is added to the new location and deleted
4545
from its original location.
4646

47+
If the specified destination path resolves to an existing non-container item, or you're renaming
48+
and an item with the target name already exists, this cmdlet raises an error. To overwrite an
49+
existing item in these cases, specify the **Force** parameter. When the destination is an existing
50+
container (such as a directory), the item is moved into that container, if supported by the
51+
provider.
52+
4753
## EXAMPLES
4854

4955
### Example 1: Move a file to another directory and rename it

reference/7.5/Microsoft.PowerShell.Management/Move-Item.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 02/26/2024
5+
ms.date: 04/01/2026
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.5&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or
4444
subkey from one key to another. When you move an item, it is added to the new location and deleted
4545
from its original location.
4646

47+
If the specified destination path resolves to an existing non-container item, or you're renaming
48+
and an item with the target name already exists, this cmdlet raises an error. To overwrite an
49+
existing item in these cases, specify the **Force** parameter. When the destination is an existing
50+
container (such as a directory), the item is moved into that container, if supported by the
51+
provider.
52+
4753
## EXAMPLES
4854

4955
### Example 1: Move a file to another directory and rename it

reference/7.6/Microsoft.PowerShell.Management/Move-Item.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 02/26/2024
5+
ms.date: 04/01/2026
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.6&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or
4444
subkey from one key to another. When you move an item, it is added to the new location and deleted
4545
from its original location.
4646

47+
If the specified destination path resolves to an existing non-container item, or you're renaming
48+
and an item with the target name already exists, this cmdlet raises an error. To overwrite an
49+
existing item in these cases, specify the **Force** parameter. When the destination is an existing
50+
container (such as a directory), the item is moved into that container, if supported by the
51+
provider.
52+
4753
## EXAMPLES
4854

4955
### Example 1: Move a file to another directory and rename it

0 commit comments

Comments
 (0)