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 7 years and 6 days 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.
I was wondering if it's possible to create a form that only asks for the user's credentials by invoking Get-Credential. When the credentials are collected in a variable it then launches another form with these credentials. So the new form is running under the credentials provided by 'Get-Credential'.
Is something like this possible? Currently we use a 'Caller.ps1' script that only launches 'Get-Credential', which we then use to call the main PowerShell ps1 script created in PowerShell Studio.
So, after some searching I think this is what we need:
If you don't know the user you are going to be using until run time, then you will want to create a bootstrapper packaged executable that will ask from the credentials and have that script run a secondary executable using those credentials.
Every time I try to incorporate the following line in Login.psf or Startup.pss, a black PowerShell window pops-up that calls the form and can't get closed as it stays in the background. I can't even close it with Exit or anything else.
It's not best practice but from the deploy tab you have copy to clipboard so you could design a form then when you press the button on that form paste the copied clipboard code then you can pass the variable along that way
This topic is 7 years and 6 days 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.