In a directory i do
Get-Item *.txt
When there is one .txt file inside the directory it returns a System.IO.FileSystemInfo
When there are more .txt files it returns a System.Array
What is the best way to handle this inconsistency? I.e. how do i find out if the function returned an object or an array. Or even better, is there a way that Get-Item always returns an array?
I want to pass the result into an other function. This function expects an array of System.IO.FileSystemInfo objects.