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.
Locked
User avatar
petera
Posts: 6
Joined: Wed Apr 19, 2017 8:30 am

Pass parameters to another forms application.

Post by petera » Wed Oct 10, 2018 4:28 pm

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 4 times
DepositsUpdate.zip
(578.41 KiB) Downloaded 6 times

User avatar
davidc
Posts: 5475
Joined: Thu Aug 18, 2011 4:56 am

Re: Pass parameters to another forms application.

Post by davidc » Thu Oct 11, 2018 1:36 pm

[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: 6
Joined: Wed Apr 19, 2017 8:30 am

Re: Pass parameters to another forms application.

Post by petera » Mon Oct 15, 2018 3:36 pm

I was able to get that to work. Thanks.

Locked