Pass parameters to another forms application.

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 5 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
petera
Posts: 11
Last visit: Thu Jun 15, 2023 8:52 am

Pass parameters to another forms application.

Post by petera »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio 2018 v5.5.154
32 or 64 bit version of product: 64
Operating system: Server 2012 R2
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***

I have created a forms PSF project that i am using to update customers. The form is what I call an MultiBankUpdateMgr" that is used to extract a zip file, that contains an update PSF project, that I call "DepositsUpdate" that does the actual update.

The MultiBankUpdateMgr calls the DepositsUpdate, and I need to pass a filePath parameter called multibankXmlFilePath to the DepositsUpdate program.

I would like the DepositsUpdate to be an exe file, but am willing to do anything to get it to work. No matter how I try to pass the parm to the project, the DepositsUpdate says the parameter is blank.

I have tried:
Start-Process Powershell.exe -ArgumentList " -noexit -File `"$startProg`" '$multibankXmlFilePath' " -Verb runas
Start-Job -filepath $startProg -argumentlist $multibankXmlFilePath
Invoke-Command -filepath $startProg -ArgumentList $multibankXmlFilePath
Nothing works.

I have attached both projects to this.
Attachments
MultiBankUpdateMgr.zip
(325.56 KiB) Downloaded 121 times
DepositsUpdate.zip
(578.41 KiB) Downloaded 104 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Pass parameters to another forms application.

Post by davidc »

[TOPIC MOVED TO THE POWERSHELL GUIS FORUM BY MODERATOR]

You need to have a parameter block in the startup.pss file and then pass the parameter again to the Show-OnboardUpdate_psf reference function.

I recommend reading the following articles:

Passing parameter to a packaged executable:

https://info.sapien.com/index.php/packaging-deployment/passing-parameters-to-a-script-in-an-executable-file

Passing parameters to GUI forms:

https://info.sapien.com/index.php/guis/gui-scripting/powershell-studio-passing-and-returning-values-using-forms
David
SAPIEN Technologies, Inc.
User avatar
petera
Posts: 11
Last visit: Thu Jun 15, 2023 8:52 am

Re: Pass parameters to another forms application.

Post by petera »

I was able to get that to work. Thanks.
This topic is 5 years and 5 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