Hi,
looks strange, but try to use write-output instead of write-host, or convert $($VDtests) to ascii. Looks like that special characters in variable.
Cheers,
Christian
Looks like that the something wrong with the enviroment. Agent get the data in system context. Please check if the information is available without user context.