Really odd problem here.
Basically, I'm working on a BCD repair script that is run from a WinPE-based image. If I forcibly invalidate and rebuild the BCD, I get an entry with guid XYZ in bcdedit. If I then attempt "reagentc /enable /osguid XYZ" after setting the image, I get an error that the BCD has not yet been configured, and to run bcdboot (which is odd, since I just did that).
However, if I then run bcdedit.exe /enum /v again, the OS identifier's GUID has completely changed, to guid ABC. If I then use this new GUID in "reagentc /enable /osguid ABC", it then enables WinRE without a problem.
I haven't had a chance to figure out if the GUID is changing in the BCD itself or if it's an odd issue getting bcdedit.exe to refresh, but does anyone happen to know what might be causing this?