Search found 12252 matches

by jvierra
Sun Jun 17, 2018 8:13 pm
Forum: PowerShell GUIs
Topic: combobox control to allow dynamic width of longest item
Replies: 1
Views: 26

Re: combobox control to allow dynamic width of longest item

There is really no facility in Forms to do what you ask. You would have to custom code this and adjust the position of all items around the ComboBox.
by jvierra
Sun Jun 17, 2018 8:32 am
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

1. Display the result (percent) of the SQL Query in the richtextbox (or a progress bar) or whatever. As I posted a very long time ago. What you are trying to do cannot be done with PowerShell. 1. How to run two jobs simultaneously. Examples for this are suprisingly hard to find The SQL Query job ne...
by jvierra
Sat Jun 16, 2018 1:09 pm
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

Here is a method to trap the events of the async call. $Database ='master' $BackupSetName = 'testser33' $FilePath = 'd:\testdb\testdb.bkp' $Server = 'Alpha' [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null [System.Reflection.Assembly]::LoadWithPartialName("Micr...
by jvierra
Sat Jun 16, 2018 12:51 pm
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

Try this at a CLI prompt with your database. It might provide updates: $Database ='master' $BackupSetName = 'testser33' $FilePath = 'd:\testdb\testdb.bkp' $Server = 'Alpha' [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null [System.Reflection.Assembly]::LoadWithP...
by jvierra
Sat Jun 16, 2018 12:29 pm
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

Another issues you are missing which are making this impossible for you is an understanding of SQLServer. A backup request is just a request. It will be executed by the SQLServer instance and not by PowerShell. A job will complete once the backup is requested. The way SSMS does this is to use an asy...
by jvierra
Sat Jun 16, 2018 12:01 pm
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

Here is an old demo showing how to access the form during a JT run.
by jvierra
Sat Jun 16, 2018 11:48 am
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

I have a working version, using the Button - start Job, which is fine with me. Now I would love to know how to get some sort of progress from that -UpdateScript { Param ($Job) $Counter = 1 + $Counter $results = Receive-Job -Job $Job -Keep I added a Counter to have some value that counts up at least...
by jvierra
Sat Jun 16, 2018 11:42 am
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

Try this form. Don't run under the debugger just open and run the form. Click the Start button anf notice that it shows the rotating image for about 5 seconds then the button is re-enabled.

If this doesn't work then you have system issues.
by jvierra
Fri Jun 15, 2018 4:51 pm
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

I thought I would take a minute to add some extra info about control events, the naming method and management of the events. Every control has a default event. If you double click any control it will open the editor to an inserted event block or to an existing event block. All events are initially n...
by jvierra
Fri Jun 15, 2018 8:06 am
Forum: PowerShell GUIs
Topic: Button - Start Job, how to multiple arguments, how to work with objects
Replies: 31
Views: 448

Re: Button - Start Job, how to multiple arguments, how to work with objects

What you are looking at is the code and not the linkage. The linkage is on each control. Be sure the code is linked.