I’m excited about this script. Currently I have it working for 2 levels of simple links. Actually no links are in this version but can easily be add to the fourth element of the table. I have been able to create a submenu but not a sub-sub-menu. I believe it has to do with the way I access terms in the termset. I’m only about to get to the top terms. Help–I know you gurus can figure this out.  Once I get the table working–I want to take the table out and use a csv parameter.
Found the answer:
Replaced “foreach($term in $termSet.Terms)”Â
with
 foreach($term in $termSet.GetAllTerms())Â
This maybe documented somewhere–but what happens is that $termSet.Terms only goes through the first row and it will never find the matching guid and complete without creating the third level.