Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ You can't use `Rename-Item` to both rename and move an item. Specifically, you c
for the value of the **NewName** parameter, unless the path is identical to the path specified in
the **Path** parameter. Otherwise, only a new name is permitted.

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

```powershell
Rename-Item -Path "project.txt" -NewName "d:\archive\old-project.txt"
```
Expand All @@ -67,6 +64,9 @@ At line:1 char:12
stination "d:\archive\old-project.txt"
```

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

Use the `Move-Item` cmdlet, instead.

### Example 3: Rename a registry key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ You can't use `Rename-Item` to both rename and move an item. Specifically, you c
for the value of the **NewName** parameter, unless the path is identical to the path specified in
the **Path** parameter. Otherwise, only a new name is permitted.

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

```powershell
Rename-Item -Path "project.txt" -NewName "d:\archive\old-project.txt"
```
Expand All @@ -67,6 +64,9 @@ At line:1 char:12
stination "d:\archive\old-project.txt"
```

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

Use the `Move-Item` cmdlet, instead.

### Example 3: Rename a registry key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ You can't use `Rename-Item` to both rename and move an item. Specifically, you c
for the value of the **NewName** parameter, unless the path is identical to the path specified in
the **Path** parameter. Otherwise, only a new name is permitted.

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

```powershell
Rename-Item -Path "project.txt" -NewName "d:\archive\old-project.txt"
```
Expand All @@ -67,6 +64,9 @@ At line:1 char:12
stination "d:\archive\old-project.txt"
```

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

Use the `Move-Item` cmdlet, instead.

### Example 3: Rename a registry key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ You can't use `Rename-Item` to both rename and move an item. Specifically, you c
for the value of the **NewName** parameter, unless the path is identical to the path specified in
the **Path** parameter. Otherwise, only a new name is permitted.

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

```powershell
Rename-Item -Path "project.txt" -NewName "d:\archive\old-project.txt"
```
Expand All @@ -67,6 +64,9 @@ At line:1 char:12
stination "d:\archive\old-project.txt"
```

This example attempts to rename the `project.txt` file in the current directory to `old-project.txt`
in the `D:\Archive` directory. The result is the error shown in the output.

Use the `Move-Item` cmdlet, instead.

### Example 3: Rename a registry key
Expand Down