PS GUI for Helpdesk/Desktop Support (Assistance required)

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 6 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
User avatar
Private_P
Posts: 3
Last visit: Sat Dec 16, 2017 4:09 am

PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by Private_P »

Hi,
I am very new to Powershell and hence purchased Powershell studio to try to help me create some useful GUI's more efficiently.

I have done the easy part and drafted up the GUI and created & Found online some scripts that I plan on using, however I am having difficulty getting the script output to show in the datagridview/output box in the GUI.
I also cant figure out why a simply test-connection/PINg isnt working in the GUI Script, but in a standalone powershell window it does. Any ideas or suggestions would be greatly appreciated.
Thanks,
[attachment=0]UserTools.psf.psbuild[/attachment]
[attachment=1]UserTools.psf[/attachment]
Attachments
UserTools.psf.psbuild
(1.57 KiB) Downloaded 150 times
UserTools.psf
(69.39 KiB) Downloaded 176 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by jvierra »

Your code has obvious syntax errors that you need to fix first.

UserTools.psf (243, 128): ERROR: At Line: 243 char: 128
ERROR: + ... tial $cred | Select-Object _server, name, descropath | $datagridview1
ERROR: + ~~~~~~~~~~~~~~
ERROR: Expressions are only allowed as the first element of a pipeline.
ERROR: + CategoryInfo : ParserError: (:) [], ParseException
ERROR: + FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline
ERROR:


I also recommend learning PowerShell to a reasonable level of proficiency before trying to use forms.

Her eis a good place to learn forms basics: https://info.sapien.com/index.php/guis/ ... nistrators
User avatar
Private_P
Posts: 3
Last visit: Sat Dec 16, 2017 4:09 am

Re: PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by Private_P »

Thanks
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by jvierra »

I did take a look at you UI. Nice start. YOu seem to have a good sense of how to use PSS and your layout is good for a first try.

Everything in a GUI happens in an event. All results from any PS command usually needs to be converted in some way to be used in a control. The link I posted has many items listed on the left that can give you information and examples on how to use most types of controls. There is also a list of bog articles that walk through various elements and show how to use forms.

For a good tutorial on PowerShell try this: https://mva.microsoft.com/en-us/trainin ... shell-8276

Here is an older but good video by Jeffery Snover and Don Jones (two of the best, Snover invented PowerShell and Jones wrote one of the first comprehensive books on PowerShell: https://www.youtube.com/watch?v=t4a2I0ryU5Y
User avatar
localpct
Posts: 397
Last visit: Thu Oct 27, 2022 5:57 am

Re: PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by localpct »

Things I recommend:
Try everything in the PowerShell ISE first then integrate it into PSS. If you understand what you're doing, the form and your script will work.
Use Projects instead of single forms. If you decide later you need a child form, it's muuuuuuch easier than joining 2 single forms.

Great job on the gui :D
User avatar
Private_P
Posts: 3
Last visit: Sat Dec 16, 2017 4:09 am

Re: PS GUI for Helpdesk/Desktop Support (Assistance required)

Post by Private_P »

Thanks all
Much appreciated.
This topic is 6 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