I'm trying to build a comma separated list of file names in a specific folder. These files tend to have long names (they're test case results and the name is very descriptive).
I've found that Get-ChildItem ignores files whose name (including path) is too long.
# Folder contains the following file (240 chars, actual name is 'only' 210 chars):
# SomeServiceWithAnAlreadyLongNameUnderTest_NameOfTheParticularTestSuiteThatProducedThisResult-NameOfTheActualMethodUnderTest-Given_A_Certain_Precondition_Is_Met_WhenCalling_With_Someparameter_As_SomeValue_Then_Result_Is_Something-Failed.txt
Get-ChildItem *.txt -name
# I would have loved for this to work:
(Get-ChildItem *.txt -name) -join ','
The result does not include the file, since the path+filename are too long. There's no error or warning either.
As a work around I'm using a cmd script file with for:
for %%a in (%XMLPath%\*.xml) do ( ... build comma separated list with %%a ... )
How can I the full list including (too?) long names in Powershell?