Run a Powershell script with Foglight

Hello,

I tried to to add Powershell script to the Foglight.
I tried to just put the powershell in the foglight (with the Script Agent Builder), and i get an error. I saw that I need to create bat file that will point to the powershell and to zip them together. now I get the following error.

2018-07-31 16:48:19.023 DEBUG2 [ScriptReader-fb8be857-fbcf-4747-973d-295a8570e581/EWS_CMD/1.0.2/EWS_CMD/EWS_CMD@labfoglight] com.quest.glue.core.jcollector.ScriptContext - Raw input: C:\Quest\Foglight\fglam\state\default\agents\fb8be857-fbcf-4747-973d-295a8570e581\EWS_CMD\1.0.2\script>powershell -noexit "& ""C:\Quest\Foglight\fglam\state\default\agents\fb8be857-fbcf-4747-973d-295a8570e581\EWS\1.0.1\script\EWS.ps1"""
2018-07-31 16:48:19.023 DEBUG [ScriptReader-fb8be857-fbcf-4747-973d-295a8570e581/EWS_CMD/1.0.2/EWS_CMD/EWS_CMD@labfoglight] com.quest.glue.core.jcollector.ScriptContext - Unknown input from a running script agent: C:\Quest\Foglight\fglam\state\default\agents\fb8be857-fbcf-4747-973d-295a8570e581\EWS_CMD\1.0.2\script>powershell -noexit "& ""C:\Quest\Foglight\fglam\state\default\agents\fb8be857-fbcf-4747-973d-295a8570e581\EWS\1.0.1\script\EWS.ps1"""
2018-07-31 16:48:20.102 WARN [ProcessReader-4] com.quest.common.io.StreamLogger - JCollector Script STDERR: Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version

I would appreciate if anyone could help me.

Thanks
Menahem Avraham

Parents
No Data
Reply
  • Hi Menahem

    Few question

    1. Can you run EWS.ps1 manually?
    2. Can you update the batch script to add 64 bit PowerShell path.

                e.g from powershell -noexit EWS.ps1

                to %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit EWS.ps1

    64 bits version: C:\Windows\System32\WindowsPowerShell\v1.0

    32 bits version: C:\Windows\SysWOW64\WindowsPowerShell\v1.0

     

    The error you got are “No snap-ins have been registered for Windows PowerShell version” which make me think you might running the wrong version (32bit?)

    Please feel free to open service request https://support.quest.com/create-service-request if this does work.

    Best Regards

    -Lee

Children
No Data