ExpandString not working for StubPath with Set-ActiveSetup

Set-ActiveSetup sets the StubPath entry to be an ‘Expandable String’. This doesn’t seem to work for me on my test machines. I’m trying to do a ‘reg import’.
If I change the StubPath to just a ‘String’ value, it works. The User key was getting updated with the Key and Version number, but the StubPath was never run. Now it is.
Why is REG_EXPAND_SZ being used and not REG_SZ?

REG_EXPAND_SZ strings can include windows environment variables such as %temp%. Windows knows to treat them as such and expand them to their actual values. However, looking at the code in our function, we expand the StubPath prior to writing it to the registry. Therefore, it would be just fine to write it as a REG_SZ. I’m not sure why a REG_EXPAND_SZ would cause any problems for you, but I will go ahead and change the function to write a REG_SZ as it makes no difference, from my point of view, because the variable expansion is performed prior to writing to the registry anyways.

You can test out the latest beta 3.6.4 with this fix include from this location:

We’re using an older version of the Toolkit in production right now. We’ll be moving to the latest version this summer. I made the modification myself to the Set-Activesetup function we have in our Extensions file. REG_SZ works fine REG_EXPAND_SZ gets ignored.