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 1 week 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 uploaded an example here, hope that makes it more clear what is happening = form in which software installed is loaded. The richtextbox shows which item you selected, I would like to add manipulations on those selections later.
Selection (clicking on an item in the gridview) works well sometimes but then some clicks (selections) nothing happens, then it selects again correctly.
Your example runs with many errors. It is stopping functioning because of some code that is being executed. I don't think anyone is going to want to debug 1000 lines of your code for you.
I can see no reason for so many lines to just click a row. Try starting a new PSF and just add the minimum code required to test the grid. After you get the minimal amount working then add the other pieces a little at a time util you find where the code is damaged.
All programmers have to learn how to debug code. It can be very challenging if you have a limited understanding of the technology that you are trying to debug wit but it is how we all learn. There are many blogs, books and magazines that dedicate time to issues of debugging difficult programs.
You will also find it easier to use SelectionChanged and full row select. This will be easier to manage and is also closer to how we manage a grid result. Consider that the grid is "global" and its values are accessible when you wan to use them. There is no need to capture them in set of global variables.
TO design manageable software it is necessary to have a clear statement of what you are expecting in terms of inputs, outputs and behaviors. I can see you are loading a grid and selecting something. It appears that you are trying to force the script to use a progress bar but it is not clear why you need one. Loading those registry keys takes only a second.
ERROR: [ALPHA] Connecting to remote server ALPHA failed with the following error message : WinRM cannot process the request. The following error with errorcode
ERROR: 0x8009030e occurred while using Negotiate authentication: A specified logon session does not exist. It may already have been terminated.
ERROR: Possible causes are:
ERROR: -The user name or password specified are invalid.
ERROR: -Kerberos is used when no authentication method and no user name are specified.
ERROR: -Kerberos accepts domain user names, but not local user names.
ERROR: -The Service Principal Name (SPN) for the remote computer name and port does not exist.
ERROR: -The client and remote computers are in different domains and there is no trust between the two domains.
ERROR: After checking for the above issues, try the following:
ERROR: -Check the Event Viewer for events related to authentication.
ERROR: -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
ERROR: Note that computers in the TrustedHosts list might not be authenticated.
ERROR: -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting
ERROR: ConvertTo-DataTable : Cannot validate argument on parameter 'InputObject'. The argument is null. Provide a valid value for the argument, and then try running
This topic is 7 years and 1 week 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.