@mnagel I’m not sure I’m following your mention of Groovy. @aarkkelin did not mention LM Support confusing this PowerShell snippet with Groovy.
That said, the Support agent’s assertion is correct. By default, Get-Command will get commands for the local host it is being executed on. The code written in the module definition is always ran on the Collector host and, by default, within the Collector’s standalone PowerShell script engine (SPSE).
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.3#description
https://www.logicmonitor.com/support/terminology-syntax/scripting-support/embedded-powershell-scripting
The PropertySource script would need to leverage the Invoke-Command, and optionally PowerShell session, to run against a remote host. I do think your suggestion of referencing ‘Microsoft_Powershell_Info’ is very helpful. @aarkkelin On top of referencing that core PropertySource, I’ll leave you with this page as well. There’s some helpful snippets for you reference.
https://www.logicmonitor.com/support/logicmodules/datasources/powershell-support/using-powershell-scripts-in-logicmonitor
And some additional links bc I have them all open right now in my browser 😅
https://www.logicmonitor.com/support/terminology-syntax/scripting-support/powershell-tips-tricks
https://www.logicmonitor.com/support/configuring-winrm-for-windows-collector
https://www.logicmonitor.com/support/agent-conf-file-configurations#powershell