From fbdebe344dad99bccece69cc42d2516166591166 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Wed, 1 Apr 2026 11:56:10 -0500 Subject: [PATCH 1/2] (AB-538639) Add note for destination exists to `Move-Item` --- .../5.1/Microsoft.PowerShell.Management/Move-Item.md | 8 +++++++- .../7.4/Microsoft.PowerShell.Management/Move-Item.md | 8 +++++++- .../7.5/Microsoft.PowerShell.Management/Move-Item.md | 8 +++++++- .../7.6/Microsoft.PowerShell.Management/Move-Item.md | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md index 68263a10c5e8..c738e9f418f7 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 02/26/2024 +ms.date: 04/01/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. +If the specified destination path resolves to an existing non-container item, or you're renaming +and an item with the target name already exists, this cmdlet raises an error. To overwrite an +existing item in these cases, specify the **Force** parameter. When the destination is an existing +container (such as a directory), the item is moved into that container, if supported by the +provider. + ## EXAMPLES ### Example 1: Move a file to another directory and rename it diff --git a/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md index f999cba51440..1960cc90e6ee 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 02/26/2024 +ms.date: 04/01/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. +If the specified destination path resolves to an existing non-container item, or you're renaming +and an item with the target name already exists, this cmdlet raises an error. To overwrite an +existing item in these cases, specify the **Force** parameter. When the destination is an existing +container (such as a directory), the item is moved into that container, if supported by the +provider. + ## EXAMPLES ### Example 1: Move a file to another directory and rename it diff --git a/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md index b293f6c9b6ea..b6d52339c565 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 02/26/2024 +ms.date: 04/01/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. +If the specified destination path resolves to an existing non-container item, or you're renaming +and an item with the target name already exists, this cmdlet raises an error. To overwrite an +existing item in these cases, specify the **Force** parameter. When the destination is an existing +container (such as a directory), the item is moved into that container, if supported by the +provider. + ## EXAMPLES ### Example 1: Move a file to another directory and rename it diff --git a/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md index a27fe5f2c339..b82bf96ff6d3 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 02/26/2024 +ms.date: 04/01/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -44,6 +44,12 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. +If the specified destination path resolves to an existing non-container item, or you're renaming +and an item with the target name already exists, this cmdlet raises an error. To overwrite an +existing item in these cases, specify the **Force** parameter. When the destination is an existing +container (such as a directory), the item is moved into that container, if supported by the +provider. + ## EXAMPLES ### Example 1: Move a file to another directory and rename it From cd508c947f6902544d795f4c90bc99dc68ccd8fc Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 1 Apr 2026 13:56:08 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Sean Wheeler --- .../5.1/Microsoft.PowerShell.Management/Move-Item.md | 9 ++++----- .../7.4/Microsoft.PowerShell.Management/Move-Item.md | 9 ++++----- .../7.5/Microsoft.PowerShell.Management/Move-Item.md | 9 ++++----- .../7.6/Microsoft.PowerShell.Management/Move-Item.md | 8 ++++---- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md index c738e9f418f7..08744b18e9d9 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Move-Item.md @@ -44,11 +44,10 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. -If the specified destination path resolves to an existing non-container item, or you're renaming -and an item with the target name already exists, this cmdlet raises an error. To overwrite an -existing item in these cases, specify the **Force** parameter. When the destination is an existing -container (such as a directory), the item is moved into that container, if supported by the -provider. +If the specified destination path resolves to an existing non-container item, or you're moving and +the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the +**Force** parameter. When the destination is an existing container (such as a directory), the item +is moved into that container, if supported by the provider. ## EXAMPLES diff --git a/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md index 1960cc90e6ee..6e3225e7cd44 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Move-Item.md @@ -44,11 +44,10 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. -If the specified destination path resolves to an existing non-container item, or you're renaming -and an item with the target name already exists, this cmdlet raises an error. To overwrite an -existing item in these cases, specify the **Force** parameter. When the destination is an existing -container (such as a directory), the item is moved into that container, if supported by the -provider. +If the specified destination path resolves to an existing non-container item, or you're moving and +the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the +**Force** parameter. When the destination is an existing container (such as a directory), the item +is moved into that container, if supported by the provider. ## EXAMPLES diff --git a/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md index b6d52339c565..06e53d5f78f0 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Move-Item.md @@ -44,11 +44,10 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. -If the specified destination path resolves to an existing non-container item, or you're renaming -and an item with the target name already exists, this cmdlet raises an error. To overwrite an -existing item in these cases, specify the **Force** parameter. When the destination is an existing -container (such as a directory), the item is moved into that container, if supported by the -provider. +If the specified destination path resolves to an existing non-container item, or you're moving and +the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the +**Force** parameter. When the destination is an existing container (such as a directory), the item +is moved into that container, if supported by the provider. ## EXAMPLES diff --git a/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md b/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md index b82bf96ff6d3..51de86e9fa7f 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Move-Item.md @@ -44,10 +44,10 @@ For example, it can move a file or subdirectory from one directory to another or subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location. -If the specified destination path resolves to an existing non-container item, or you're renaming -and an item with the target name already exists, this cmdlet raises an error. To overwrite an -existing item in these cases, specify the **Force** parameter. When the destination is an existing -container (such as a directory), the item is moved into that container, if supported by the +If the specified destination path resolves to an existing non-container item, or you're moving and +the target name already exists, this cmdlet raises an error. To overwrite an existing item, use the +**Force** parameter. When the destination is an existing container (such as a directory), the item +is moved into that container, if supported by the provider. provider. ## EXAMPLES