File tree Expand file tree Collapse file tree 4 files changed +28
-8
lines changed
5.1/Microsoft.PowerShell.Management
7.4/Microsoft.PowerShell.Management
7.5/Microsoft.PowerShell.Management
7.6/Microsoft.PowerShell.Management Expand file tree Collapse file tree 4 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 01/18 /2026
5+ ms.date : 04/01 /2026
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/rename-item?view=powershell-5.1&WT.mc_id=ps-gethelp
77schema : 2.0.0
88aliases :
@@ -40,6 +40,10 @@ content of the item being renamed.
4040You can't use ` Rename-Item ` to move an item, such as by specifying a path together with the new
4141name. To move and rename an item, use the ` Move-Item ` cmdlet.
4242
43+ You can't use ` Rename-Item ` to replace an existing item, such as renaming ` log_new.txt ` to
44+ ` log_current.txt ` when ` log_current.txt ` already exists. To replace an existing item, use the
45+ ` Move-Item ` cmdlet with the ** Force** parameter.
46+
4347## EXAMPLES
4448
4549### Example 1: Rename a file
@@ -152,7 +156,8 @@ or read-only aliases or variables. The cmdlet can't change constant aliases or v
152156Implementation varies from provider to provider. For more information, see
153157[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
154158
155- Even using the **Force** parameter, the cmdlet can't override security restrictions.
159+ Even using the **Force** parameter, the cmdlet can't override security restrictions or replace an
160+ existing item at the destination name specified by **NewName**.
156161
157162` ` ` yaml
158163Type : System.Management.Automation.SwitchParameter
Original file line number Diff line number Diff line change 22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 01/18 /2026
5+ ms.date : 04/01 /2026
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/rename-item?view=powershell-7.4&WT.mc_id=ps-gethelp
77schema : 2.0.0
88aliases :
@@ -39,6 +39,10 @@ content of the item being renamed.
3939You can't use ` Rename-Item ` to move an item, such as by specifying a path together with the new
4040name. To move and rename an item, use the ` Move-Item ` cmdlet.
4141
42+ You can't use ` Rename-Item ` to replace an existing item, such as renaming ` log_new.txt ` to
43+ ` log_current.txt ` when ` log_current.txt ` already exists. To replace an existing item, use the
44+ ` Move-Item ` cmdlet with the ** Force** parameter.
45+
4246## EXAMPLES
4347
4448### Example 1: Rename a file
@@ -151,7 +155,8 @@ or read-only aliases or variables. The cmdlet can't change constant aliases or v
151155Implementation varies from provider to provider. For more information, see
152156[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
153157
154- Even using the **Force** parameter, the cmdlet can't override security restrictions.
158+ Even using the **Force** parameter, the cmdlet can't override security restrictions or replace an
159+ existing item at the destination name specified by **NewName**.
155160
156161` ` ` yaml
157162Type : System.Management.Automation.SwitchParameter
Original file line number Diff line number Diff line change 22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 01/18 /2026
5+ ms.date : 04/01 /2026
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/rename-item?view=powershell-7.5&WT.mc_id=ps-gethelp
77schema : 2.0.0
88aliases :
@@ -39,6 +39,10 @@ content of the item being renamed.
3939You can't use ` Rename-Item ` to move an item, such as by specifying a path together with the new
4040name. To move and rename an item, use the ` Move-Item ` cmdlet.
4141
42+ You can't use ` Rename-Item ` to replace an existing item, such as renaming ` log_new.txt ` to
43+ ` log_current.txt ` when ` log_current.txt ` already exists. To replace an existing item, use the
44+ ` Move-Item ` cmdlet with the ** Force** parameter.
45+
4246## EXAMPLES
4347
4448### Example 1: Rename a file
@@ -151,7 +155,8 @@ or read-only aliases or variables. The cmdlet can't change constant aliases or v
151155Implementation varies from provider to provider. For more information, see
152156[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
153157
154- Even using the **Force** parameter, the cmdlet can't override security restrictions.
158+ Even using the **Force** parameter, the cmdlet can't override security restrictions or replace an
159+ existing item at the destination name specified by **NewName**.
155160
156161` ` ` yaml
157162Type : System.Management.Automation.SwitchParameter
Original file line number Diff line number Diff line change 22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 01/18 /2026
5+ ms.date : 04/01 /2026
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/rename-item?view=powershell-7.6&WT.mc_id=ps-gethelp
77schema : 2.0.0
88aliases :
@@ -39,6 +39,10 @@ content of the item being renamed.
3939You can't use ` Rename-Item ` to move an item, such as by specifying a path together with the new
4040name. To move and rename an item, use the ` Move-Item ` cmdlet.
4141
42+ You can't use ` Rename-Item ` to replace an existing item, such as renaming ` log_new.txt ` to
43+ ` log_current.txt ` when ` log_current.txt ` already exists. To replace an existing item, use the
44+ ` Move-Item ` cmdlet with the ** Force** parameter.
45+
4246## EXAMPLES
4347
4448### Example 1: Rename a file
@@ -151,7 +155,8 @@ or read-only aliases or variables. The cmdlet can't change constant aliases or v
151155Implementation varies from provider to provider. For more information, see
152156[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
153157
154- Even using the **Force** parameter, the cmdlet can't override security restrictions.
158+ Even using the **Force** parameter, the cmdlet can't override security restrictions or replace an
159+ existing item at the destination name specified by **NewName**.
155160
156161` ` ` yaml
157162Type : System.Management.Automation.SwitchParameter
You can’t perform that action at this time.
0 commit comments