Invoke-UDredirect and variables

we construct menus from json files as shown below:

we would like to make some of the menus ‘dynamic’ in that they contain a redirect which has a correct SID eg.


$SID is defined in the page.

however when we run our code to generate menus, the querystring is in this format


this is when we use invoke-udirect $redirect

is this to be expected?

“Category”: “Users”,
“Label”: “edit user”,
“Redirect”: “/eu?$SID”,
“Icon”: “air_freshener”,
“Enabled”: true,
“toolbox”: true