... actually, I just figured it out. Nice thing about writing out a problem. Thank you. However, there's probably a better way, so I'll keep posting this.
David...
So, everything is going great. I've got systems that can PXEboot to Linux (liveCD environments) or drop down to the local Windows boot manager with multiple VHDX boot options that I can add to on the fly. We've even got Linux as a local boot option as well, again just copied to the drive as a file (or a few files at any rate). I have PowerShell scripts that let me copy over and add VHDX images to multiple target machines, customizing the unattend files in the process... 100s of machines at a go. Works great, the instructors love it.
So, now I'm trying to clean up the mess. Via PowerShell, I can now take the output of BCDedit and dump it in a hash of hashes, basically a hash for each identifier. But, I've run into a stupid problem and I can't find the way out.
BCDedit /enum /v gives me a list of entries, each having an {...} identifier. BCDedit by itself gives me a list of entries where the well known identifiers are replaced by {current} etc. That's nice. But, I can't figure out which of the {...} identifiers IS the {current} boot. It seems trivial, BCDedit obviously knows the answer, but I can't get it to tell me.
I could just link them together by comparing the 'device' fields... but that will fall apart if I end up having 2 boot entries that point to the same device. Yeah, this has already happened. Things get a little messy when developing a new imaging system a week before classes start. Anyway, I can manually fix machines that get mucked like this, but I'd rather have code robust enough to handle it.
I've now realized that I can collect the identifiers from bcdedit /enum /v and subtract the not "well known" identifiers I get from bcdedit itself... the ones left will be current and default, and default is easy.
So, I can do it. But, is there an easier way? I feel like I'm missing something simple.