Confused with -Include parameter of the Get-ChildItem cmdlet

后端 未结 6 1630

From documentation:

-Include

Retrieves only the specified items. The value of this parameter qualifies the Path parameter. Enter a pa

6条回答
  •  离开以前
    2020-12-06 18:07

    Tacking on to JaredPar's answer, in order to do pattern matching with Get-ChildItem, you can use common shell wildcards.

    For example:

    get-childitem "c:\test\t?st.txt"
    

    where the "?" is a wildcard matching any one character or

    get-childitem "c:\test\*.txt"
    

    which will match any file name ending in ".txt".

    This should get you the "simpler" behavior you were looking for.

提交回复
热议问题