Product, version and build: PSS 2016 5.2.129
32 or 64 bit version of product: 64
Operating system: Win 7 Enterprise 64bit
PowerShell Version:5
I am trying to pass textbox.text to a script to run a command which will then return a result to the parent form. The command needs to be run by script because it does not return a result from the form. Having followed the passing parameters between forms blog post I have set up a similar script which doesn't rely on any variables being fetched from the parent but for the life of me cannot get this to pass to the script.
This is from the parent form
$buttonCloseFile_Click = {
Call-closesession_ps1 | Out-Host
#Write-Host "$closef"
}
This is from the script
if ((Call-MainForm_psf) -eq "ok")
{
$id = $MainForm_textbox2
openfiles /disconnect /s <fileserver> /ID "$id"
}
Another copy of the parent form opens when the button is pressed.
Passing form variable to a script to then return a result back to the form
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.
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.
- simon.briggs
- Posts: 10
- Last visit: Mon Feb 01, 2021 6:18 am
- simon.briggs
- Posts: 10
- Last visit: Mon Feb 01, 2021 6:18 am
Re: Passing form variable to a script to then return a result back to the form
Update: Having realised that I can't use a variable to define a parameter I have changed to using script variables instead.
testing now to confirm that it is working but it looks to have resolved my issue.
testing now to confirm that it is working but it looks to have resolved my issue.
Re: Passing form variable to a script to then return a result back to the form
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.