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.

/eu?Sid=1-1-11

$SID is defined in the page.

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

eu?SID=$SID/S-1-5-21

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
},