parsing a text file

by Oct 14, 2011


i'm trying to parse a text file and it's doing my head in. any help is appreciated.

the file is a registry dump so it is of the format


and being the registry the values could also be listed out of order


What i'm trying to do is obtain the value name and the data it contains, then output them in order to a csv file.

reading the input with get-content is straightforward enough, as is outputting the csv once i have objects to give it, but i seem to be going in circles trying to capture what should be a straightforward name/value data pair.