I have a directory structure like: \\NetworkPath\FixedDir1\FixedDir2\Client. Inside Client directory I have lots of directories and each of these directories have one text file inside them.
\\NetworkPath\FixedDir1\FixedDir2\Client\
qwertyuiop --> dir
apple.txt
asdfghjklzx --> dir
gold.txt
mnbvcxzlkj --> dir
cat.txt
I want to build a powershell script that take the directory names in a text file list, look for a list of directory names and save a two columns output. One column with the name of the directory and the other column with the full name of the file inside that directory. E.g.
My input to the powershell script: a file.txt with a list of directory names (mentioned above):
qwertyuiop
asdfghjklzx
mnbvcxzlkj
....
could be thousands of directory names
The output within a Excel File:
DirectoryName FileName
qwertyuiop apple.txt
asdfghjklzx gold.txt
mnbvcxzlkj cat.txt
Thanks in advanced.
Regards,