I need to get all the files including the files present in the subfolders that belong to a particular type.
I am doing something like this, using Get-ChildItem:
If relative paths are what you want you can just use the -Name flag.
-Name
Get-ChildItem "C:\windows\System32" -Recurse -Filter *.txt -Name