I am afraid to say, I copy'pasta'd the script into a Windows PowerShell Monitor, changed the URL and it worked. both on my Orion server with Execution Mode: as both local and remote, without issue.
And then tried it remotely on another server with Execution Mode Remote Host and it worked there too.
Have you tried enabling the debug options and looking at the logs?
At the top of your template, under the polling intervals you'll find the Advanced button.
From the application view of your template, at the end of the URL and you will see something like: NetObject=AA:<number> where the number is the application ID.
On the Orion server, that the the node is polled from, navigate to C:\ProgramData\SolarWinds\Logs\APM\ApplicationLogs directory (default path) and look for the AppID folder that matches your ApplicationID (sort by date and newest files it'll be near/at the top).
Hope it helps
Thanks yaquaholic, knowing that it *can* work helped. I did some more packet captures and found that it does seem to be working but is trying to go out the corporate proxies here. Long story short the site I'm trying to monitor can't go through the proxies, so I'll need to figure that out.
Looks like I need to upgrade to PowerShell 6 to get a -NoProxy option
Is there a setting to have Solarwinds reference PowerShell 6?
Not sure. Had already spent too much time on trying to make it work without a proxy and decided to write a bash script using curl on linux instead.
Pretty sure it just uses the system default.
Try running this within a test application template, PowerShell component:
$version = $psversiontable.PSVersion
$edition = $psversiontable.PSEdition
write-host "Statistic: $version"
write-host "Message: $edition"
And run it, making sure you have Execution Mode: Local Host before hand.
And you'll know what version you're running.
As a thought, could you not use Invoker-Command -Computer etc... to run the command from a server that can bypass the proxy?