Wrong Values from Windows Agent

Hi Daniel,

our Windows devs are already in christmas vacation and neither Alex nor me are experts in Powershell development…

But are you really sure you get always the right result? No http errors, always right content et al?
Could it be your script returns that fast because used invoke-webrequest does not work like expected for this user?

Please try this script as your test user and check the output:

$response = Measure-Command { $request = Invoke-WebRequest -Uri “SOMEURL” -UseBasicParsing }
write-host "=============="
write-host "REQUEST object"
write-host "=============="
$request
write-host "==============="
write-host "RESPONSE object"
write-host "==============="
$response

If you want to check this back using with agent you should either redirect the output to some logfile or create it as plugin file instead of local check, outputting something like <<<webrequest_debug>>> as first line…

BR,
Marsellus W.

3 Likes