Skip to content

Commit 40d69ff

Browse files
(AB-538639) Add note for destination exists to Move-Item (#12914)
* (AB-538639) Add note for destination exists to `Move-Item` * Apply suggestions from code review Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com> --------- Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
1 parent 5d9f217 commit 40d69ff

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

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

Lines changed: 6 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,11 @@ 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 moving and
48+
the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the
49+
**Force** parameter. When the destination is an existing container (such as a directory), the item
50+
is moved into that container, if supported by the provider.
51+
4752
## EXAMPLES
4853

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

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

Lines changed: 6 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,11 @@ 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 moving and
48+
the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the
49+
**Force** parameter. When the destination is an existing container (such as a directory), the item
50+
is moved into that container, if supported by the provider.
51+
4752
## EXAMPLES
4853

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

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

Lines changed: 6 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,11 @@ 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 moving and
48+
the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the
49+
**Force** parameter. When the destination is an existing container (such as a directory), the item
50+
is moved into that container, if supported by the provider.
51+
4752
## EXAMPLES
4853

4954
### 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 moving and
48+
the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the
49+
**Force** parameter. When the destination is an existing container (such as a directory), the item
50+
is moved into that container, if supported by the provider.
51+
provider.
52+
4753
## EXAMPLES
4854

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

0 commit comments

Comments
 (0)