Hi,
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.