B
Bob Landau
The grammer for Get-ChildItem states that -Include/-Exclude are valid for
either the -Path or -LiteralPath parameter. Does anyone know whether this is
a documentation error or not?
From what I've seen either -Include or -Exclude is totally ignored. While
the below example is not useful; it is a simple example that illustrates the
behavor I'm seeing.
## works as expected
Get-ChildItem -path C:\windows\system32\* -include [xyz]*.dll
## returns nothing which I'm assuming is expected.
Get-ChildItem -path C:\windows\system32\ -include [xyz]*.dll
## fails '*' is an illegal character
Get-ChildItem -LiteralPath C:\windows\system32\* -include [xyz]*.dll
## returns everything in the System folder which makes no sense to me.
Get-ChildItem -LiteralPath C:\windows\system32\ -include [xyz]*.dll
## returns everything in the System folder and below which makes no sense to
me.
Get-ChildItem -LiteralPath C:\windows\system32\ -include [xyz]*.dll -recurse
In all these examples using 'LiteralPath', -Include and -Exclude can be used
interchangeable; the results are the same.
Lastly what does the helpfile mean in the -Exclude sub-section when it states?
'This parameter does not work properly in this cmdlet'
thx
bob
either the -Path or -LiteralPath parameter. Does anyone know whether this is
a documentation error or not?
From what I've seen either -Include or -Exclude is totally ignored. While
the below example is not useful; it is a simple example that illustrates the
behavor I'm seeing.
## works as expected
Get-ChildItem -path C:\windows\system32\* -include [xyz]*.dll
## returns nothing which I'm assuming is expected.
Get-ChildItem -path C:\windows\system32\ -include [xyz]*.dll
## fails '*' is an illegal character
Get-ChildItem -LiteralPath C:\windows\system32\* -include [xyz]*.dll
## returns everything in the System folder which makes no sense to me.
Get-ChildItem -LiteralPath C:\windows\system32\ -include [xyz]*.dll
## returns everything in the System folder and below which makes no sense to
me.
Get-ChildItem -LiteralPath C:\windows\system32\ -include [xyz]*.dll -recurse
In all these examples using 'LiteralPath', -Include and -Exclude can be used
interchangeable; the results are the same.
Lastly what does the helpfile mean in the -Exclude sub-section when it states?
'This parameter does not work properly in this cmdlet'
thx
bob