This guide will discuss the usage of the “Get-ItemPropertyValue” cmdlet.
How to Use the Get-ItemPropertyValue (Microsoft.PowerShell.Management) Cmdlet in PowerShell?
To use the “Get-ItemPropertyValue” cmdlet, first, add the stated cmdlet. Then, provide it with a property, such as the path of a file/directory or a registry key. Lastly, use the “-Name” parameter to get the property value.
Let’s have a look at the practical examples to learn the usage of the “Get-ItemPropertyValue” cmdlet.
Example 1: Use the “Get-ItemPropertyValue” Cmdlet to Get the Last Edit Time of a File or Directory
Initially, use the “Get-ItemPropertyValue” cmdlet. Then, place the “-Path” parameter and specify the directory address. Lastly, use the “-Name” parameter and assign it the “LastWriteTime” value to get the last edit time of the directory or a file:
Example 2: Use the “Get-ItemPropertyValue” Cmdlet to Get the Creation Time of a Directory
To retrieve the creation time of a directory, use the “-Name” parameter and specify the “CreationTime” value:
Example 3: Use the “Get-ItemPropertyValue” Cmdlet to Get the Value of the PID Property
To get the value of the PID property of a registry key, first, use the “Get-ItemPropertyValue” cmdlet. Then, specify the registry key. After that, write the parameter “-Name” and specify it to the “PID” property:
Example 4: Use the “Get-ItemPropertyValue” Cmdlet to Get the Values of Multiple Properties
To use multiple properties, simply assign the properties to the “-Name” parameter in PowerShell:
That’s it! You have learned the usage of the “Get-ItemPropertyValue” cmdlet in PowerShell.
Conclusion
In PowerShell, the “Get-ItemPropertyValue” cmdlet is used to get the property value of a specified item by the user located in the provided path. This tutorial explained the usage of the “Get-ItemPropertyValue” cmdlet in PowerShell.