Job parameters have the datatype String, but Powershell functions can have typed parameters. PowershellComponentNet4's Execute*Command tasks attempt automatic datatype conversion. Which limitations exist?
The tasks use Get-Command in the initialised powershell environment in order to read the parameter types. Conversion is possible for primitive datatypes, e.g. integer, float, bool, DateTime, string. If the conversion fails, the tasks use a string parameter.
There are some examples, e.g. Set-Mailbox and the parameter -SCLJunkEnabled, where Get-Command lists the parameter as System.Object even though a bool value is expected. In such instances, automatic conversion is not possible and an Execute*Script task is required. The same is true for non-primitive parameter types.
Please note, when using an Execute*Script task, the $ sign is already interpreted by OneIMs scripting environment and has to be escaped as $$, e.g.
Value = "Get-User -Parameter1 $$Test -Parameter2 $$AnotherTest"
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center