CmdID / PowerShell / Cmdlets / Get
Get-Item
Gets the item at the specified location. PowerShell reference
From the PowerShell reference
15 parameters
Alias gi
What it does
Gets the item at the specified location. The Get-Item cmdlet gets the item at the specified location. It doesn't get the contents of the item at the location unless you use a wildcard character (*) to request all the contents of the item. This cmdlet is used by PowerShell providers to navigate through different types of data stores. Some parameters are only available for a specific provider. For more information, see about_Providers.
Get-Item [-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [-Credential <PSCredential>] [-UseTransaction] [-Stream <String[]>] [<CommonParameters>]Get-Item -LiteralPath <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [-Credential <PSCredential>] [-UseTransaction] [-Stream <String[]>] [<CommonParameters>]Get-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] [-UseTransaction] [-CodeSigningCert] [-DocumentEncryptionCert] [-SSLServerAuthentication] [-DnsName <string>] [-Eku <string[]>] [-ExpiringInDays <int>] [<CommonParameters>]Get-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] [-UseTransaction] [-CodeSigningCert] [-DocumentEncryptionCert] [-SSLServerAuthentication] [-DnsName <string>] [-Eku <string[]>] [-ExpiringInDays <int>] [<CommonParameters>]Get-Item [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>]Get-Item -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>]
Get the current directory
Get-Item .IdentifyGet all the items in the current directory
Get-Item *IdentifyGet the current directory of a drive
Get-Item C:IdentifyGet items in the specified drive
Get-Item C:\*IdentifyGet a property in the specified directory
(Get-Item C:\Windows).LastAccessTimeIdentifyShow the contents of a registry key
Get-Item HKLM:\Software\Microsoft\PowerShell\1\Shellids\Microsoft.PowerShell\IdentifyGet items in a directory that have an exclusion
Get-Item C:\Windows\*.* -Exclude "w*"IdentifyIts page in the reference: Get-Item.
Parameters
-CodeSigningCertThis is a dynamic parameter made available by the Certificate provider.
To get certificates that have Code Signing in their EnhancedKeyUsageList property value, use the CodeSigningCert parameter.
For more information, see about_Certificate_Provider.-CredentialNOTE: This parameter isn't supported by any providers installed with PowerShell. To impersonate another user, or elevate your credentials when running this cmdlet, use Invoke-Command.-DnsNameThis is a dynamic parameter made available by the Certificate provider.
Specifies a domain name or name pattern to match with the DNSNameList property of certificates the cmdlet gets. The value of this parameter can either be Unicode or ASCII. Punycode values are converted to Unicode. Wildcard characters (*) are permitted.
This parameter was reintroduced in PowerShell 7.1
For more information, see about_Certificate_Provider.-DocumentEncryptionCertThis is a dynamic parameter made available by the Certificate provider.
To get certificates that have Document Encryption in their EnhancedKeyUsageList property value, use the DocumentEncryptionCert parameter.
For more information, see about_Certificate_Provider.-EkuThis is a dynamic parameter made available by the Certificate provider.
Specifies text or a text pattern to match with the EnhancedKeyUsageList property of certificates the cmdlet gets. Wildcard characters (*) are permitted. The EnhancedKeyUsageList property contains the friendly name and the OID fields of the EKU.
This parameter was reintroduced in PowerShell 7.1
For more information, see about_Certificate_Provider.-ExcludeSpecifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as *.txt. Wildcard characters are permitted. The Exclude parameter is effective only when the command includes the contents of an item, such as C:\Windows\*, where the wildcard character specifies the contents of the C:\Windows directory.-ExpiringInDaysThis is a dynamic parameter made available by the Certificate provider.
Specifies that the cmdlet should only return certificates that are expiring in or before the specified number of days. A value of zero (0) gets certificates that have expired.
This parameter was reintroduced in PowerShell 7.1
For more information, see about_Certificate_Provider.-FilterSpecifies a filter to qualify the Path parameter. The FileSystem provider is the only installed PowerShell provider that supports filters. Filters are more efficient than other parameters. The provider applies filter when the cmdlet gets the objects rather than having PowerShell filter the objects after they're retrieved. The filter string is passed to the .NET API to enumerate files. The API only supports * and ? wildcards.-ForceIndicates that this cmdlet gets items that can't otherwise be accessed, such as hidden items. Implementation varies from provider to provider. For more information, see about_Providers. Even using the Force parameter, the cmdlet can't override security restrictions.-IncludeSpecifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as *.txt. Wildcard characters are permitted. The Include parameter is effective only when the command includes the contents of an item, such as C:\Windows\*, where the wildcard character specifies the contents of the C:\Windows directory.-LiteralPathSpecifies a path to one or more locations. The value of LiteralPath is used exactly as it's typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.
For more information, see about_Quoting_Rules.-PathSpecifies the path to an item. This cmdlet gets the item at the specified location. Wildcard characters are permitted. This parameter is required, but the parameter name Path is optional.
Use a dot (.) to specify the current location. Use the wildcard character (*) to specify all the items in the current location.-SSLServerAuthenticationThis is a dynamic parameter made available by the Certificate provider.
To get certificates that have Server Authentication in their EnhancedKeyUsageList property value, use the SSLServerAuthentication parameter.
For more information, see about_Certificate_Provider.-StreamThis is a dynamic parameter made available by the FileSystem provider.
Gets the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are supported. To get all streams, use an asterisk (*). This parameter isn't valid on folders.
This parameter was introduced in PowerShell 3.0.
For more information, see about_FileSystem_Provider.-UseTransactionIncludes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions.