From 5b7e8481ae4db9488a626fed885da59d9c10af9d Mon Sep 17 00:00:00 2001 From: Bobby Reed Date: Tue, 21 May 2019 06:41:00 -0400 Subject: [PATCH] Fixes #4264 Explain Exclude with Registry keys --- .../Get-ChildItem.md | 18 ++++++++++++++-- .../Get-ChildItem.md | 18 ++++++++++++++-- .../Get-ChildItem.md | 18 ++++++++++++++-- .../Get-ChildItem.md | 18 ++++++++++++++-- .../Get-ChildItem.md | 21 +++++++++++++++++-- 5 files changed, 83 insertions(+), 10 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/3.0/Microsoft.PowerShell.Management/Get-ChildItem.md index e3d431f77944..68bab95b6291 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -295,8 +295,22 @@ RESOURCEMAP UEFI ``` -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The -hive's path and top level of registry keys are displayed in the PowerShell console. +```powershell +Get-ChildItem -Path HLKM:\HARDWARE -Exclude D* +``` + +```Output + Hive: HKEY_LOCAL_MACHINE\HARDWARE + +Name Property +---- -------- +ACPI +RESOURCEMAP +``` + +The first command shows the contents of the `HKLM:\HARDWARE` registry key. The **Exclude** parameter +tells `Get-ChildItem` not to return any subkeys that start with `D*`. Currently, the **Exclude** +parameter only works on subkeys, not item properties. ### Example 7: Get all certificates with code-signing authority diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/4.0/Microsoft.PowerShell.Management/Get-ChildItem.md index 6cd974be6b61..fa0fe9176564 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -295,8 +295,22 @@ RESOURCEMAP UEFI ``` -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The -hive's path and top level of registry keys are displayed in the PowerShell console. +```powershell +Get-ChildItem -Path HLKM:\HARDWARE -Exclude D* +``` + +```Output + Hive: HKEY_LOCAL_MACHINE\HARDWARE + +Name Property +---- -------- +ACPI +RESOURCEMAP +``` + +The first command shows the contents of the `HKLM:\HARDWARE` registry key. The **Exclude** parameter +tells `Get-ChildItem` not to return any subkeys that start with `D*`. Currently, the **Exclude** +parameter only works on subkeys, not item properties. ### Example 7: Get all certificates with code-signing authority diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/5.0/Microsoft.PowerShell.Management/Get-ChildItem.md index 1635af2570f3..d82a3b1f1b5d 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -295,8 +295,22 @@ RESOURCEMAP UEFI ``` -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The -hive's path and top level of registry keys are displayed in the PowerShell console. +```powershell +Get-ChildItem -Path HLKM:\HARDWARE -Exclude D* +``` + +```Output + Hive: HKEY_LOCAL_MACHINE\HARDWARE + +Name Property +---- -------- +ACPI +RESOURCEMAP +``` + +The first command shows the contents of the `HKLM:\HARDWARE` registry key. The **Exclude** parameter +tells `Get-ChildItem` not to return any subkeys that start with `D*`. Currently, the **Exclude** +parameter only works on subkeys, not item properties. ### Example 7: Get all certificates with code-signing authority diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md index 9c50253fe2b4..69a850fae44a 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -297,8 +297,22 @@ RESOURCEMAP UEFI ``` -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The -hive's path and top level of registry keys are displayed in the PowerShell console. +```powershell +Get-ChildItem -Path HLKM:\HARDWARE -Exclude D* +``` + +```Output + Hive: HKEY_LOCAL_MACHINE\HARDWARE + +Name Property +---- -------- +ACPI +RESOURCEMAP +``` + +The first command shows the contents of the `HKLM:\HARDWARE` registry key. The **Exclude** parameter +tells `Get-ChildItem` not to return any subkeys that start with `D*`. Currently, the **Exclude** +parameter only works on subkeys, not item properties. ### Example 7: Get all certificates with code-signing authority diff --git a/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md index 49144a9d6524..6179c86c3db1 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -250,9 +250,9 @@ optional. For example, `-Path C:\Test\Logs` or `-Path C:\Test\Logs\*`. ### Example 6: Get the registry keys from a registry hive -This command gets all of the registry keys from the **HKEY_LOCAL_MACHINE\HARDWARE** registry hive. +This command gets all of the registry keys from the `HKEY_LOCAL_MACHINE\HARDWARE` registry key. -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The +`Get-ChildItem` uses the **Path** parameter to specify the registry key `HKLM:\HARDWARE`. The hive's path and top level of registry keys are displayed in the PowerShell console. For more information, see [about_Registry_Provider](../Microsoft.PowerShell.Core/About/about_Registry_Provider.md). @@ -273,6 +273,23 @@ RESOURCEMAP UEFI ``` +```powershell +Get-ChildItem -Path HLKM:\HARDWARE -Exclude D* +``` + +```Output + Hive: HKEY_LOCAL_MACHINE\HARDWARE + +Name Property +---- -------- +ACPI +RESOURCEMAP +``` + +The first command shows the contents of the `HKLM:\HARDWARE` registry key. The **Exclude** parameter +tells `Get-ChildItem` not to return any subkeys that start with `D*`. Currently, the **Exclude** +parameter only works on subkeys, not item properties. + ### Example 7: Get all certificates with code-signing authority This command gets each certificate in the PowerShell **Cert:** drive that has code-signing