There seems to be a difference between these two uses of Get-ChildItem
.
Get-ChildItem -File -Path 'C:\SVN\SSIS\AtomicLoad\Atomic_NPI\*.dtsx'
Get-ChildItem -File -Path 'C:\SVN\SSIS\AtomicLoad\Atomic_NPI' -Filter '*.dtsx'
They both report using Get-Member that they produce TypeName: System.IO.FileInfo
.
However, using the -Filter
parameter causes Get-Content
to look for the file Name in the current working directory.
Get-ChildItem -File -Path 'C:\SVN\SSIS\AtomicLoad\Atomic_NPI' -Filter '*.dtsx' |
ForEach-Object { Get-Content -Path $_ }
Whereas, not using -Filter
has Get-Content
looking for the $_.FullName which works.
Get-ChildItem -File -Path 'C:\SVN\SSIS\AtomicLoad\Atomic_NPI\*.dtsx' |
ForEach-Object { Get-Content -Path $_ }
Why is this?