Adding Additional Properties to PSObject

I am trying to get my head around how all of the scoping, and endpoints work, but am having some trouble. I have been able to get a few dashboards kind of working, but when I come to add new properties, the objects don’t seem to work like normal objects.

For example, I have been using New-UDEndpoint on a schedule in order to get a a list of AD Users. Once I have these users, I then want to add a few custom properties and then use this modified PSObject. I then thought that I needed to copy the standard PSObject to a $Cached value, so I have tried this too.

$Schedule = New-UDEndpointSchedule -Every 10 -Minute
$Endpoint_ADComplianceResults = New-UDEndpoint -Schedule $Schedule -Endpoint {
    $ADComplianceResults = Get-ADUser -SearchBase "OU=Regional,DC=global,DC=root" -Filter *
    foreach ($ADComplianceResult in $ADComplianceResults) {
        Add-Member -InputObject $ADComplianceResult -Force -MemberType NoteProperty -Name 
"MoreInfo" -Value "Example Data"

$Cache:ADComplianceResults = $ADComplianceResults


Is there something special that I need to do in order to alter PSObjects before using them elsewhere?
NOTE: This is a very dumbed down example compared to what I am trying to achieve. It is just for demonstration purposes.

Dude you need to use the $cache variable inside the endpoint as well as in the main script file
$Schedule = New-UDEndpointSchedule -Every 10 -Minute
$Endpoint_ADComplianceResults = New-UDEndpoint -Schedule $Schedule -Endpoint {

Sorry, I messed the formatting up a little.
I was using the $Cache variable in my New-UDEndpoint Endpoint block, and then using it in the -Endpoint parameter of a later function.

I don’t know exactly what happened, but the example in my question does actually seem to work when I run the config from the script file, and not just highlighting and pressing F8.

Sorry for delay fella, have you had a read of:-