When run with the following command, Powershell.exe -ExecutionPolicy Bypass -NoLogo -File C:\\ProgramData\\Sensu\\config\\get-module.ps1
where the script contains the command get-module
, all i get from the agent is
Check did not write to STDOUT.
which is consistent with when i run it manually.
When i run the check with command get-module
i get the following output
'get-module' is not recognized as an internal or external command, operable program or batch file.
This is because the agent would run this on command line rather than on a powershell terminal.
Finally i tried to run the powershell script on the instance directly and i got the following output on executing the file C:\\ProgramData\\Sensu\\config\\get-module.ps1
> C:\ProgramData\Sensu\config\get-module.ps1
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
I have asked my Windows engineer to help me out here as well