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.
This topic is 4 years and 4 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
klarlichter
Posts: 40
Last visit: Sun Jan 16, 2022 3:44 am

call a ps1 by psf and grab values

Post by klarlichter »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: call a ps1 by psf and grab values

Post by jvierra »

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
Last visit: Sun Jan 16, 2022 3:44 am

Re: call a ps1 by psf and grab values

Post by klarlichter »

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
Last visit: Sun Jan 16, 2022 3:44 am

Re: call a ps1 by psf and grab values

Post by klarlichter »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: call a ps1 by psf and grab values

Post by jvierra »

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
Last visit: Sun Jan 16, 2022 3:44 am

Re: call a ps1 by psf and grab values

Post by klarlichter »

Please refer to that post: viewtopic.php?f=21&t=14391
I describe now issues step by step in logical topic. :)
This topic is 4 years and 4 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