I implemented a new script to our system yesterday that uses onPostGet to retrieve information and show information on a form after it loads. I have traced it down to running QAD commandlets in the onPostGet function. This leads to errors like:
Recursion is too deep; nested policy execution limit has been exceeded.
I've inserted an out-file inside to export the results of the QAD command, it seems to be running the command just fine but it's constantly running the onPostGet function over and over and over again, leaking RAM until the service crashes. If I delete the text file, it immediately comes back indicating a loop issue.
What I'm trying to do is to get group information, which I modified to use a $Request.AddRequestedAttribute in onPreGet and call that in onPostGet instead of the QAD commandlet, which fixed the looping but I need to also look up membership.
I've tried to use the $Request.AddRequestAttribute("Members") and call $Request.Get("Members") but that does not return a value. Calling Get-QADGroupMember causes the loop again.