ExpandString not working for StubPath with Set-ActiveSetup

//ExpandString not working for StubPath with Set-ActiveSetup
ExpandString not working for StubPath with Set-ActiveSetup 2015-05-04T13:16:01+00:00

The Toolkit Forums General ExpandString not working for StubPath with Set-ActiveSetup

  • Author
    Posts
  • macxcool
    Participant
    Post count: 23
    #203 |

    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?

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    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:
    https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/tree/master/Toolkit/AppDeployToolkit

  • macxcool
    Participant
    Post count: 23

    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.

You must be logged in to reply to this topic.