How to limit virtual attributes retrieval?

Hi Community,

I recently added a lot of virtual attributes to my user class, and got them populated 'on the fly' (no DB storage of their values) by an "OnPostGet" trigger in a script module.

As the retrieval of each value takes a little time, it runs for approx. 1 second to retrieve them all.

Unfortunately, when 1 more second to get user's "properties" window to pop-up remains acceptable, the tool becomes absolutely unusable when I try to display the content of an OU with several users, in there. The OU can take minutes to just display its content !! And same goes for a generic "Get-QADUser" command...

It appears that the script populates values for every user even if they just get listed :-(

So now my concern is about how I can control when these specific attributes get populated or not...

I would need to find a way to makes these not populated unless these are really expected, like when displaying the "Advanced Properties" tab, or if these are explicitly listed in the "-IncludedProperties" parameter of a Get-QADUser cmdlet.

Any idea would highly help!

Thanks to all in advance :)