What are you trying to check against as a value?
Have you looked to see what kind of backlog you have for scans in the ldmain\ldscan folder? If this is big then you might want to look at either the speed of your core/database or intriducing a deliberate delay into the provisioning process to allow the scans to get processed.
Couple of questions:
How many devices does your core support?
How soon after the agent is installed are you trying to do an IF check?
MarXtar Ltd/MarXtar Corporation
Ivanti One Development Partner
Try MarXtar State Management for Ivanti to Better Understand and Manage your Assets
So this core is brand new - 2016.3 with about 10 devices on it. No backlog on scan folder - the agent installs and scans. i then force a full sync and the env variable is not listed under inventory.
Currently looking at using a powershell script to test the env instead as the delay is too much.