The Get-Folderstructure function I included in file1.ps1 should be correct.
The Select line you mention is just one wy of assignig properties Name and Children to he object in $folder.
The values for both properties re filled in later in the function.