Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Sam Wu
2017-05-31T18:26:53Z
I'm trying to pass in a boolean parameter, but VCron keeps passing every parameter as a string. I don't see a way to pass a typed parameter other than string:

ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 108775)->System.Management.Automation.ParameterBindingArgumentTransformationException: Cannot process argument transformation on parameter 'IgnoreEmptyResults'. Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. ---> System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. ---> System.Management.Automation.PSInvalidCastException: Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.
at System.Management.Automation.ArgumentTypeConverterAttribute.ThrowPSInvalidBooleanArgumentCastException(Type resultType, Type convertType)
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)
--- End of inner exception stack trace ---
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
Sponsor
Forum information
Support
2017-06-01T08:02:36Z
Can you please add a very simple sample script?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Sam Wu
2017-06-05T22:09:59Z
Here is my sample script. I cannot pass in the parameter.

param (
[bool] $IgnoreEmptyResults
)

$IgnoreEmptyResults

ErikC
2017-06-07T06:15:30Z
Hi Sam Wu, welcome to the forum!

I tried this also and used my previous post to set it up (Use parameters in Powershell ) and got the same error result. I also tried the [switch] type, but this also gets the error of not parsing a string to the SwitchParameter.

If you don't fill in the parameters underneath the parameters button, it works fine, but than you can't pass in variables... 😢

Regards,
Erik
Uses Visualcron since 2006.
Support
2017-06-07T12:14:49Z
This would require some changes for us. I am moving this to Feature requests.

Meanwhile you can just take in parameters as strings and convert them in Powershell instead.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Sam Wu
2017-06-15T12:40:25Z
Thanks for replying. I hope this will get added, since this seems like a fairly fundamental feature in Powershell. For now I am using a work-around by using the "Powershell Script text" instead of "Powershell file", which seems to work fine for any type of parameters.

Sam
it@berag
2019-10-10T17:35:47Z
Originally Posted by: Support 

This would require some changes for us. I am moving this to Feature requests.



Please, implement. It is not solved yet.

Support
2019-11-18T14:26:08Z
It has now been implemented in this build. Please check the requirements on top of the post:

https://www.visualcron.c....aspx?g=posts&t=9663 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top