call a ps1 by psf and grab values

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.
Post Reply
klarlichter
Posts: 40
Joined: Tue Nov 19, 2019 1:17 am

call a ps1 by psf and grab values

Post by klarlichter » Sun Nov 24, 2019 11:23 am

Hello.
I create a PSF with different text box. I save that values from text box into a txt file and also can read that values from txt file.

Now i want insert a button into psf and call an ps1 script inside that project. How I can call a ps1 script I understand. I use: Invoke-CertExServer16_ps1 (because of description by viewtopic.php?t=13768 )
But how i can also tell that ps1 script some variables from my psf?

jvierra
Posts: 14000
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: call a ps1 by psf and grab values

Post by jvierra » Sun Nov 24, 2019 12:36 pm

To call a PS1 script from any other script just call it by full file name

c:\test\myscript.ps1

The link referenced only applies to scripts combined into a project.

klarlichter
Posts: 40
Joined: Tue Nov 19, 2019 1:17 am

Re: call a ps1 by psf and grab values

Post by klarlichter » Sun Nov 24, 2019 12:59 pm

Hello, yes my ps1 script in the same project like that other. That is why i use that call. (that: Invoke-CertExServer16_ps1 )
But how i can use a varibale who i create on psf inside my ps1 script?
And is it is possible to show that ps1 script output inside a porccessbar?

klarlichter
Posts: 40
Joined: Tue Nov 19, 2019 1:17 am

Re: call a ps1 by psf and grab values

Post by klarlichter » Sun Nov 24, 2019 1:27 pm

It would be great if i press the button run script that after that press a little window open and show the output of the script.
I create also a form who called progress.psf but i dont know how i can display there inisde a textbox that output of invoke-myscript_ps1

jvierra
Posts: 14000
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: call a ps1 by psf and grab values

Post by jvierra » Sun Nov 24, 2019 1:36 pm

I apologize but I cannot quite understand your issue. I suspect it is, in part, a language issue.

Try asking one question and give an example of what you have tried.

klarlichter
Posts: 40
Joined: Tue Nov 19, 2019 1:17 am

Re: call a ps1 by psf and grab values

Post by klarlichter » Sun Nov 24, 2019 1:42 pm

Please refer to that post: viewtopic.php?f=21&t=14391
I describe now issues step by step in logical topic. :)

Post Reply