Powershell

How to Use the Rename-ItemProperty Cmdlet to Rename an Item’s Property in PowerShell?

Renaming of an item can be done using the GUI(Graphical User In). In Powershell, the cmdlet “Rename-ItemProperty” is used to rename an item’s property. However, changing the name of an item will not change its value. For instance, it can change the registry name without changing its value. The standard alias of the “Rename-ItemProperty” cmdlet is the “rnp”.

This tutorial will explain the usage of the “Rename-ItemProperty” cmdlet in PowerShell.

How to Use the Rename-ItemProperty Cmdlet to Rename an Item’s Property in PowerShell?

Renaming an item’s property can be done using the “Rename-ItemProperty” cmdlet. To do so, first, use the stated cmdlet and assign it a path via the “-Path” parameter. After that, use the “-Name” parameter to assign the item’s existing name. Next, add the “-NewName” parameter and specify the new name.

Let’s have a look at the given example for a better understanding!

Example: Use the “Rename-ItemProperty” Cmdlet to Rename a Registry Entry

To rename an item’s property, simply, execute the given command in PowerShell:

Rename-ItemProperty -Path HKLM:\Software\NewSoftware -Name Developers -NewName Dev

According to the above code:

  • First, use the “Rename-ItemProperty” cmdlet and provide it a path using the “-Path” parameter.
  • Then, write the parameter “-Name” and specify the old item’s property name.
  • Next, type the “-NewName” parameter and specify the new desired name:

Run the below-mentioned command to verify whether the item’s property was removed or not:

Get-ItemProperty -Path "HKLM:\Software\NewSoftware"

That’s it! You have learned about PowerShell’s “Rename-ItemProperty” cmdlet.

Conclusion

The “Rename-ItemProperty” cmdlet is used to rename the property of an item in PowerShell. Its standard alias is the “rnp”. This tutorial demonstrated the usage of the “Rename-ItemProperty” cmdlet with the help of practical examples.

About the author

Muhammad Farhan

I am a Computer Science graduate and now a technical writer who loves to provide the easiest solutions to the most difficult problems related to Windows, Linux, and Web designing. My love for Computer Science emerges every day because of its ease in our everyday life.