Help debug on local check

Dear Forum.

I have written a Powershell scripts that checks the current status of Citrix PVS Image load-balancering.

This is what i have written in the code

And this is the output of check_mk_agent.exe test

But when i add the host to checkmk i get this

What clould be wrong here?

looks strange, but try to use write-output instead of write-host, or convert $($VDtests) to ascii. Looks like that special characters in variable.

Still the same view in the web interface.

I have downloaded the agent output from the webinterface and i get this

I dont se the custom text

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.

Arrh! Yes!

The command requeres Citrix Admins rights.
I will consult the Citrix Team on how to get this access to the system account of the server