I am using this command @(dsquery computer -name $server).count}
in a powershell script to do some pre-checks and also to check if removal a computer account was successfull or not.
Even if set the value to 0 and I perform the query again in the same script after removal, the result keeps on giving 1.
Also if do a start-sleep 10
after the removal the result keeps on giving 1.
If I run the query simultaneously in another script in those 10 s sleep time, the result is 0.
Is there a cache that needs to be cleared while using dsquery
multiple times in one script?