Search found 14778 matches

by jvierra
Tue Apr 06, 2021 6:23 pm
Forum: PowerShell GUIs
Topic: Cannot close form with $FormName.Close()
Replies: 9
Views: 1058

Re: Cannot close form with $FormName.Close()

No. It reminded me to look before I leap. Luckily my machine recovers to exactly the point of the crash and all apps come open and back where they were although the restart is very slow. It is a good way to have a development machine behave since crashes can be quite normal although a VM is a better...
by jvierra
Tue Apr 06, 2021 3:40 pm
Forum: PowerShell GUIs
Topic: Print results into a textbox in reverse order
Replies: 3
Views: 730

Re: Print results into a textbox in reverse order

There is no reverse order for an array. You can create a new array in reverse then assign it to the "Lines" property.

To insert lines in a list use a ListBox as inserts can be done at the top.

You can also do this.

$listbox.Text = $newline + $listbox.Text
by jvierra
Tue Apr 06, 2021 3:37 pm
Forum: PowerShell GUIs
Topic: Cannot close form with $FormName.Close()
Replies: 9
Views: 1058

Re: Cannot close form with $FormName.Close()

Place a return statement at the beginning of the load event then comment out all message boxes in the Close button event. The close will happen. Same for the other event. It is also a bad idea to restart the local system from a form. It can be done but it can also cause a system exception. I ran you...
by jvierra
Mon Apr 05, 2021 6:48 pm
Forum: PowerShell GUIs
Topic: PowerShell GUI - Hide actual URLs in RichTextBox
Replies: 2
Views: 488

Re: PowerShell GUI - Hide actual URLs in RichTextBox

A little investigation shows that you cannot create hidden text in the RichTextControl. This may be for security reasons.
by jvierra
Sun Apr 04, 2021 4:36 pm
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 668

Re: Add a calculated field to result data from a database

Sorry. I typed it backwards when I typed quickly.

Yes, the DataTable is what gets loaded and not the Reader. The reader is already loaded it just needs to be converted from a stream to a table.
by jvierra
Sun Apr 04, 2021 3:27 am
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 668

Re: Add a calculated field to result data from a database

Here is a simple example that doesn't alter the table after it is built except to assign the correct values. function Update-Grid_Database4_ComputersTable{ param( [Parameter(Mandatory)] [string[]]$ComputerName ) $connStr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=database.mdb;Password=;User ID=...
by jvierra
Sat Apr 03, 2021 10:15 am
Forum: PowerShell GUIs
Topic: Add a calculated field to result data from a database
Replies: 5
Views: 668

Re: Add a calculated field to result data from a database

There is no need to convert a data table to a DataTable as it is already a DataTable.

When adding fields to a query it is always better to add the fields in the query by just adding them in the SQL SELECT statement.
by jvierra
Fri Apr 02, 2021 10:39 am
Forum: PowerShell
Topic: Help needed to automate console output.
Replies: 3
Views: 694

Re: Help needed to automate console output.

My take is that the script in the EXE is VBScript. Although the question may be speculative then the Alex's PS solution would be the best approach.
by jvierra
Thu Apr 01, 2021 11:08 am
Forum: VBScript
Topic: how to automate console input.
Replies: 1
Views: 683

Re: how to automate console input.

Please do not post the same question in multiple forums.