Get-ItemProperty in PowerShell: Complete Guide with Examples

Last update: 14/08/2025
Author Isaac
  • Get-ItemProperty retrieves properties in FileSystem, Registry, and IIS with consistent syntax.
  • Master Path/LiteralPath, Name, Include/Exclude, Filter, and Credential to fine-tune queries.
  • Real cases: version of Windows, installed software, IIS bindings, and file metadata.
  • Advanced scenarios: remote, Windows activation, history USB and error resolution.

Get-ItemProperty Command in PowerShell

If you work with Windows and PowerShell, mastering the Get-ItemProperty cmdlet opens the door to reading properties of files, folders, registry keys, and even objects exposed by other providers. It is one of those commands which are used daily to audit systems, obtain metadata or review configurations without having to open any graphical interface.

In this practical guide you will find from its syntax and parameters to real examples applied to the Registry, the file system and IIS, along with Tricks for remote environments and troubleshooting common errors. All with a clear focus, in Spanish, and with commands ready to paste into your console, so you can work fluently from the first minute.

What is Get-ItemProperty in PowerShell?

Get-ItemProperty is a cmdlet that retrieves the properties of one or more items at a given location, respecting the underlying PowerShell provider (FileSystem, Registry, etc.). For example, you can read the LastAccessTime property of a file, get values from a registry key, or query properties of IIS objects through their provider.

The big advantage is its consistency: the same idea works across different data sources, and it also supports piping and wildcards in most scenarios via its parameters. If you move between files, registry, and namespaces like IIS, you'll feel right at home with this cmdlet.

There is also the alias gp, which is very practical for writing quickly in the console (gp is equivalent to Get-ItemProperty), and works on any provider exposed in the session. You can see the available providers with Get-PSProvider.

General use of Get-ItemProperty

How to display manuals and help for command syntax in PowerShell
Related article:
How to view help and command manuals in PowerShell

Syntax and parameter sets

Get-ItemProperty supports two main ways to specify the path: using Path (default) or LiteralPath, in addition to filtering by property name with Name. The choice between Path and LiteralPath depends on whether you need PowerShell to interpret wildcards or not.

Shape with Path (default):

Get-ItemProperty  <String[]>  <String[]>]  >] >]  

Form with LiteralPath (without interpreting wildcards):

Get-ItemProperty  <String[]>] -LiteralPath <String[]>  >] >]  

When using LiteralPath, PowerShell will not treat any characters as wildcards, and it is recommended that you enclose escaped paths in single quotes to avoid unwanted interpretations.

Syntax with Path and LiteralPath

powershell log
Related article:
How to Edit the Windows Registry with PowerShell: A Practical Guide and Commands

Key parameters and how to use them well

In addition to Path, LiteralPath, and Name, there are a number of useful parameters to master (Include, Exclude, Filter, Credential), as well as common PowerShell parameters to control the cmdlet's output and behavior. The most important ones are summarized below with their practical details.

  How to recover a Lovoo profile to restore access

-Path

Indicates the path of the element or elements and supports wildcards. It is the default parameter set, position 0, and accepts input by pipe and by property name.

  • Type: String []
  • wildcards: Yes
  • Position: 0
  • Required: Yes as a whole
  • Canalization: Yes (by value and by property name)

-LiteralPath

Exact routes without interpreting wildcards. Use it when your path contains special characters or you want to avoid interpretations. Use it with single quotes to ignore escape sequences.

  • Type: String []
  • wildcards: No
  • Alias: PSPath, LP
  • Required: Yes as a whole
  • Canalization: By property name

-Name

Filter which properties you want to retrieve by name, allowing wildcards. It is useful when you only need one or more specific properties.

  • Type: String []
  • wildcards: Yes
  • Alias: PSProperty
  • Position: 1

-Include and -Exclude

They allow you to limit which elements to include or exclude, generally effective when the Path points to the contents of a container (for example, 'C:\\Windows\\*'). Both accept wildcards and receive an array of patterns.

  • -Include Type: String[] — wildcards: Yeah - Predetermined: None
  • -Exclude Type: String[] — wildcards: Yeah - Predetermined: None

-Filter

Apply a filter at the provider level, which is more efficient than filtering later in PowerShell. The FileSystem provider is based on wildcard syntax, and reduces overhead by fetching already filtered objects.

  • Type: String
  • wildcards: Yes (depending on supplier)

-Credential

Allows you to specify credentials (PSCredential) when supported by the provider. Useful in remote scenarios or with protected access.

  • Type: PSCredential
  • Predetermined: Current user
  • wildcards: No
  • Pipe by property name: Yes

Common parameters

Supports common PowerShell switches (-Debug, -ErrorAction, -Verbose, -WarningAction, -OutVariable, etc.), very useful for error handling, verbosity, and information channeling (see about_CommonParameters).

Cmdlet inputs and outputs

Input: Accepts strings (String) with pipeline routes. This makes it easy to pass paths generated by other cmdlets directly to Get-ItemProperty.

Output: Returns an object for each returned property, the type of which depends on the provider (e.g., FileInfo or DirectoryInfo in FileSystem; specific values in Registry). Types such as String, Boolean, or DateTime may also appear depending on the property you are querying.

Inputs and outputs in Get-ItemProperty

Essential examples with FileSystem

To start, a typical case is to consult the properties of a directory or a file and, if you wish, forma tear the output to see it as a list. This gives you a quick snapshot of metadata and timestamps.

Get information from a specific folder:

Get-ItemProperty 'C:\\Windows'

List properties of a file and display them as a list:

Get-ItemProperty 'C:\\Test\\Weather.xls' | Format-List

If you want specific properties from multiple documents, combine with Select-Object for compact output. For example, for documents of Word in a user's folder:

Get-ItemProperty 'C:\\Usuarios\\Administrador\\Documents\\*.docx' | Select-Object Name, LastWriteTime, Length

For extended metadata (such as EXIF details on images) you can pull in the 'Shell.Application' COM object and read advanced properties by index. It is especially useful for photos or multimedia files:

$shell  = New-Object -ComObject 'Shell.Application'
$folder = $shell.Namespace('C:\\Photos')
$file   = $folder.ParseName('Vacation2023.jpg')
# Autor (índice 20, según la vista del shell)
$folder.GetDetailsOf($file, 20)

Working with the Windows Registry

The Registry is one of the most common destinations for Get-ItemProperty. From system information to software lists, everything is at your fingertips with the right paths and GP aliases for speed. For more in-depth information on related topics, you can check out our Tutorial for editing the registry with PowerShell.

  How to find the Crystallized Arrow in Genshin Impact? And what does it do?

Reading values from a system version key:

Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'

Take a specific property (e.g. product name):

(Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion').ProductName

Retrieve a specific value within a subkey: the path indicates the subkey and with -Name you choose the value of that entry.

Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion' -Name 'ProgramFilesDir'

Get all value names and data in a PowerShell key: you'll see properties like ApplicationBase, ConsoleHostAssemblyName, PowerShellVersion, or RuntimeVersion.

Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\PowerShellEngine'

List installed software (64-bit): This pattern is widely used in inventory. If you want to delve deeper into auditing techniques in the registry, also learn to list installed programs in Windows with PowerShell.

Get-ItemProperty 'HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*' \
  | Where-Object DisplayName -ne $null \
  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate \
  | Sort-Object DisplayName

List installed software (32-bit on 64-bit OS): Remember to check the Wow6432Node path for 32-bit applications.

Get-ItemProperty 'HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*' \
  | Where-Object DisplayName -ne $null \
  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate \
  | Sort-Object DisplayName

Another classic variant, sorting by installation date:

Get-ItemProperty 'HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*' \
  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate \
  | Sort-Object InstallDate

Check Windows version with specific properties (ideal for quick reports):

Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion' \
  | Select-Object ProductName, ReleaseId, CurrentBuild

Windows Update/System Upgrade History (Setup Keys): useful query for auditing version changes.

Get-ItemProperty -Path 'HKLM:\\SYSTEM\\Setup\\Source OS*' \
  | Select-Object PSChildName, ProductName, ReleaseId, DisplayVersion, CurrentBuild

IIS Administration: Set-ItemProperty, New-ItemProperty, Get-Item

The IIS provider allows you to manage sites, applications, virtual directories, and application pools with built-in cmdlets. You can create items with New-Item, inspect items with Get-Item, set properties with Set-ItemProperty, or add to collections with New-ItemProperty. To expand your knowledge of advanced management, we recommend visiting .

View key properties of a site named 'DemoSite': The output shows status, physical path and bindings, among other key properties.

Get-Item 'IIS:\\Sites\\DemoSite'

View a site's collection of bindings in detail: We use parentheses to evaluate first and then access the collection.

(Get-ItemProperty 'IIS:\\Sites\\DemoSite' -Name 'bindings').Collection

Inspect complex properties of an AppPool (e.g., processModel) and read its startup time:

(Get-ItemProperty 'IIS:\\AppPools\\DemoAppPool' -Name 'processModel').startupTimeLimit

Add a new binding to a site with New-ItemProperty: perfect for collections such as 'bindings'.

New-ItemProperty 'IIS:\\Sites\\DemoSite' -Name 'bindings' -Value @{ protocol = 'http'; bindingInformation = ':8081:' }

Change a simple site property with Set-ItemProperty (e.g., name):

Set-ItemProperty 'IIS:\\Sites\\DemoSite' -Name 'name' -Value 'NewDemoSite'

Reverting to its original name is as simple as reapplying Set-ItemProperty with the previous value:

Set-ItemProperty 'IIS:\\Sites\\NewDemoSite' -Name 'name' -Value 'DemoSite'

Create a local user with ADSI and run an AppPool under that identity, something common in environments that require dedicated identities:

$computer = 'WinNT://.'
$user     = $computer.Create('user', 'DemoAppPoolUser')
$user.SetPassword('Secret!!Pw3009')
$user.SetInfo()
Set-ItemProperty 'IIS:\\AppPools\\DemoAppPool' -Name 'processModel' -Value @{ userName = 'DemoAppPoolUser'; password = 'Secret!!Pw3009'; identityType = 3 }

Variation with Get-Item/Set-Item taking advantage of autocomplete: very convenient if you are going to play several properties in a row.

$demoPool = Get-Item 'IIS:\\AppPools\\DemoAppPool'
$demoPool.processModel.userName    = 'DemoAppPoolUser'
$demoPool.processModel.password    = 'Secret!!Pw3009'
$demoPool.processModel.identityType = 3
$demoPool | Set-Item

Advanced and remote scenarios

Get-ItemProperty also excels when performing remote queries, activation statuses, or even when tracking the connection of USB devices. Here are some practical ideas for real-world environments. For a deeper dive into remote administration tasks, you can check out our Tutorial on assigning static IPs in Windows.

  13 Best Places to Sell Your Manuals and Make More Money

Query the Registry remotely with Invoke-Command: useful for gathering information across multiple servers without logging into each one.

Invoke-Command -ComputerName 'SERVER01' -ScriptBlock {
  Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'
}

Check Windows activation status on multiple computers and translate the LicenseStatus code into readable text:

$computers = 'WORKSTATION01','WORKSTATION02','WORKSTATION03'
foreach ($computer in $computers) {
  try {
    $status = Invoke-Command -ComputerName $computer -ScriptBlock {
      (Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform').LicenseStatus
    } -ErrorAction Stop
    $activationStatus = switch ($status) {
      0 {'Unlicensed'}
      1 {'Licensed'}
      2 {'Out-of-Box Grace Period'}
      3 {'Out-of-Tolerance Grace Period'}
      4 {'Non-Genuine Grace Period'}
      5 {'Notification'}
      6 {'Extended Grace'}
      default {'Unknown'}
    }
    @{ Computer = $computer; ActivationStatus = $activationStatus }
  }
  catch { @{ Computer = $computer; ActivationStatus = "Error: $_" } }
}

For inventory tasks of hardware and software, you can also check out our Tutorial on system and hardware information with PowerShell.