I'm getting a difference in the handling of Get-ChildItem
between running it in a PowerShell window and in the PowerShell ISE
Test directory with 5 fives, test01.txt though test05.txt
$orbdata = 'C:\spool\RBDEV\data'
$srcfiles = @(Get-ChildItem -Path $orbdata -Filter *.txt)
$srcfiles.Length
In PowerShell window, I get the result I expected, i.e. 5
But in the ISE, same script gives result 54, i.e. the length of the string ...
test01.txt test02.txt test03.txt test04.txt test05.txt
Any suggestion as to why? ... and even better, how to fix it!