Hello,
I try to create a Item on den Zabbix-Server for the agent.
I want to get the last update date (windows Updates).
My Key is:
system.run[PowerShell.exe -nologo -command "(Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date)"]
Now I got the error:
In Zeile:1 Zeichen:45
+ (Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select- ...
+ ~
Schlie?ende ")" fehlt in einem Ausdruck.
In Zeile:1 Zeichen:115
+ ... Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date)
+ ~
Unerwartetes Token ")" in Ausdruck oder Anweisung.
+ CategoryInfo : ParserError: (
[], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : MissingEndParenthesisInExpression
Executed in a powershell-shell as
"Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date"
it works.
Any ideas?
Thanks a lot!
I try to create a Item on den Zabbix-Server for the agent.
I want to get the last update date (windows Updates).
My Key is:
system.run[PowerShell.exe -nologo -command "(Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date)"]
Now I got the error:
In Zeile:1 Zeichen:45
+ (Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select- ...
+ ~
Schlie?ende ")" fehlt in einem Ausdruck.
In Zeile:1 Zeichen:115
+ ... Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date)
+ ~
Unerwartetes Token ")" in Ausdruck oder Anweisung.
+ CategoryInfo : ParserError: (
[], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndParenthesisInExpression
Executed in a powershell-shell as
"Install-Module -Name PSWindowsUpdate -Force; Get-WUHistory | Select-Object -first 1 | Select -ExpandProperty Date"
it works.
Any ideas?
Thanks a lot!
Comment