I have a directory structure that is 2 folders deep(e.g. folder1/folder1/file1.txt, folder1/folder2/file1.txt, etc.). I need to traverse the directory structure recursively to extract all the data of the text files and put them in one large text file in the folder above. The command is:
Get-Content .\*\*\*.txt | Out-File ..\whole.txt
Here's the error for this command:
Get-Content : An object at the specified path .\*\*\*.geojson does not exist, or has been filtered by the -Include or
-Exclude parameter.
At line:1 char:1
+ Get-Content .\*\*\*.geojson | Out-File ..\whole_us.geojson
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (System.String[]:String[]) [Get-Content], Exception
+ FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetContentCommand
How do I specify wildcard paths?