Button - Start Job control: Problem sending array to Argument List parameter

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Button - Start Job control: Problem sending array to Argument List parameter

Post by davidc »

PowerShell is very aggressive when it comes to converting types and arrays behind the scenes. As an alternative, I would suggest passing a Custom PSObject instead.

You could also try creating a non-GUI script and call Start-Job directly and see if you get the same result.
David
SAPIEN Technologies, Inc.
User avatar
Brendan49
Posts: 14
Last visit: Tue Feb 13, 2024 11:06 am

Re: Button - Start Job control: Problem sending array to Argument List parameter

Post by Brendan49 »

Good idea. When I have time I'll create a custom PS object as you said with both objects embedded. That way the -Argument parameter will only see one object which it shouldn't have a problem with.

Thanks.
This topic is 5 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked