Open sergeileshchinsky opened 4 years ago
upgraded .NET upgraded WMI upgraded powershell to v6. enabled winrm
script returns data now
Still no go :(
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_job.ps1" ExportXml
does populate the xml files but zabbix complains they are not valid json (?) -> can't be processed:
discovery error:
Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'DiscoveryBackupVmsByJobs {"data":[{"{#JOBVMNAME}":"server1.my.org","{#JOBNAME}":"Medium priority (Weekly)"}, ...
moreover, after next zabbix iteration all xml are rewritten with
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04" />
example from manually populated backupsyncvmbyjob.xml:
`
For Windows 7, you must install Windows Management Framework 3.0. You can download it here : https://www.microsoft.com/en-us/download/details.aspx?id=34595
Any way to make it work on Windows 7 ?
Running into:
c:\Program` Files\Zabbix Agent>powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent\scripts \zabbix_vbr_job.ps1" DiscoveryRepo DiscoveryRepo The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_job.ps1:315 char:27
The term 'ConvertTo-Json' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_job.ps1:278 char:38
FullyQualifiedErrorId : CommandNotFoundException
get-modules for powershell returns empty list can I just add required modules?
Thanks