diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md index 2d2a85723121..61612aa3b1d8 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -520,6 +520,10 @@ For example, `-Depth 2` includes the **Path** parameter's directory, first level and second level of subdirectories. By default directory names and filenames are included in the output. +> [!NOTE] +> The **Depth** parameter has no effect when used with the **Include** parameter. To work around +> this issue, use the **Filter** parameter instead. This is fixed in PowerShell 6 and higher. + > [!NOTE] > On a Windows computer from PowerShell or **cmd.exe**, you can display a graphical view of a > directory structure with the **tree.com** command. @@ -802,6 +806,10 @@ after the inclusions, which can affect the final output. > The **Include** and **Exclude** parameters have no effect when used with the **LiteralPath** > parameter. This is fixed in PowerShell 7. +> [!NOTE] +> The **Depth** parameter has no effect when used with the **Include** parameter. To work around +> this issue, use the **Filter** parameter instead. This is fixed in PowerShell 6. + ```yaml Type: System.String[] Parameter Sets: (All)