another “interesting” discovery that i decided to post today since i ran into yet again and had forgotten why. when using the run .net script object, there are a couple of caveats while using published data. let’s run through these real quick.
first of all, to address the title of this post, we will review this error message:
You must provide a value expression on the right-hand side of the '/' operator.
running through the policy testing console, you can see the error problem expressed like this:
it turns out if you use the language type powershell, the published data type of “Date/Time” does not behave as expected.
instead, the script fails to execute. so for instance, if i wanted to retrieve a variable out of a powershell script which represents a date/time, using this type in opalis causes script execution problems. presumably the “/” (slash) in “Date/Time” is what’s causing the funkiness. instead, switch it to type string. while we’re talking about the published data, this is a good segue to the next part.
did you notice that there “collection” checkbox is grayed out? look at it again. the documentation states:
If this item of data will be multi-valued, select Collection. When using a collection you must use the Add method to add items to the collection. If you are not using the collection you can use the assignment operator (“=”) to assign the value.
i guess this doesn’t apply to powershell scripts. switching the language type to something else makes this checkbox available. interesting though. if you view the published data in the policy testing console, the collection checkbox IS available. :|
check out the next screenshot. it works anyway (as indicated by the <…>). :)