ParserError during PowerShell script execution - Bug or design?
Just to make clear, I opened a case on this, I want to hear from Support. However I also wanted to hear whether or not you have come across this.... I mean PowerShell scripting inside DataSources has been around for years so I cannot be the only one encountering this issue...here it is.
A collector incurs ParseException in DataSources using PowerShell script when parsing script parameters such as wmi.pass or wmi.user or any other device property containing single quotes.
so, typical statement in PowerShell such as;
$my_custom_device_property = '##MY.CUSTOM.PROP##'
If the value of that property contains a single quote DataSource will fail with parsing exception;
Unexpected token 'xxxxx'' in expression or statement.
I wonder.... is this fixed in EA Collector 31.100? Reading through release notes there is a reference to fixing parser exceptions but I cannot tell if this is it. I doubt it.
By the way, if you use double quotes in PS script when declaring said parameter then there is no issue. As long as the value does not contain double quote, that is, then you will get parsing exception again.