This guide will overview the “Copy-ItemProperty” cmdlet with the help of various practical examples.
How to Use the Copy-ItemProperty Cmdlet to Copy an Item’s Property in PowerShell?
To copy an item’s property, first, use the “Copy-ItemProperty” cmdlet. Then, specify the item’s path using the “-Path” parameter. Next, use the “-Destination” parameter and provide the target path where you want to copy an item’s property. Lastly, use the “-Name” parameter and specify the property to be copied.
Let’s overview the provided example to learn more.
Example: Use the “Copy-ItemProperty” Cmdlet to Copy an Item’s Property via a Registry Key to Another
In PowerShell, to copy an item’s property simply execute the following command:
According to the above code:
- Initially, utilize the cmdlet “Copy-ItemProperty” alongside the parameter “-Path” and specify it as a stated path.
- Next, use the “-Destination” parameter and specify a target path where you want to copy the desired item.
- Lastly, use the “-Name” parameter and provide it with an item’s name:
Execute the given command to verify whether the item’s property was copied or not:
That’s it! We have elaborated on the usage of the “Copy-ItemProperty” cmdlet in PowerShell.
Conclusion
The cmdlet “Copy-ItemProperty” copies a property and its values from one provided location path to another. Its standard alias is the “cpp”. When a property is copied, it does not get deleted from its original location. This tutorial illustrated the usage of PowerShell’s “Copy-ItemProperty” cmdlet.