What you are most likely looking for is what helps to distinguish a file from a folder. Fortunately, there is a call to the PSIsContainer property, which is true for the folder and false for the files.
dir -r | % { if ($_.PsIsContainer) { $_.FullName + "\" } else { $_.FullName } } C:\Source code\Base\ C:\Source code\List.txt C:\Source code\Base\main.c C:\Source code\Base\print.c
If leading path information is undesirable, you can easily delete it using -replace :
dir | % { $_.FullName -replace "C:\\","" }
Hope this gets you heading in the right direction.
source share