Search found 12901 matches

by jvierra
Fri Nov 16, 2018 2:01 am
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

You cannot easily use a hash to create a ListView. Why ae you using a hash. Convert it into an object collection and add a property that identifies the group.
by jvierra
Thu Nov 15, 2018 3:52 pm
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

You have to create a category in your collection before assigning it to items and groups. This is best an easiest done when creating the collection. Gridview controls cannot do grouping. All of your issues require advanced programming and program design skills. Perhaps you should take a simpler appr...
by jvierra
Thu Nov 15, 2018 3:07 pm
Forum: PowerShell GUIs
Topic: GUI - Display data - table format - color? how?
Replies: 47
Views: 1091

Re: GUI - Display data - table format - color? how?

You have not added any items to a group.

Please look carefully at the example I posted earlier. It shows the correct way to create items and subitems and how to add them to groups.
by jvierra
Thu Nov 15, 2018 2:33 pm
Forum: Windows PowerShell
Topic: Create Service
Replies: 4
Views: 321

Re: Create Service

The easiest way to do this with PS services is to set a restrictive ACL on the service.
by jvierra
Thu Nov 15, 2018 12:58 pm
Forum: Windows PowerShell
Topic: Cannot Add properties to Object in Powershell Studio, but works in Powershell ISE
Replies: 1
Views: 138

Re: Cannot Add properties to Object Studio, but works in Powershell ISE

The issue is that the code in the ISE and in the form are completely different. Each has a different fundamental scope which causes the "$result" array to not be saved in the form. Here is how to remedy scope in a form: $script:result = @() $buttonGo_Click={ $User = Get-ADUser $txtUsername.Text $scr...
by jvierra
Thu Nov 15, 2018 7:17 am
Forum: PowerShell GUIs
Topic: Powershell studio msgbox close freeze main form
Replies: 7
Views: 152

Re: Powershell studio msgbox close freeze main form

Glad we got you going. 😊😎
by jvierra
Thu Nov 15, 2018 5:52 am
Forum: PowerShell GUIs
Topic: Powershell studio msgbox close freeze main form
Replies: 7
Views: 152

Re: Powershell studio msgbox close freeze main form

I placed a progress control set on a new form and ran it without making a single change and it works without delay. Something in your form must be causing an issue which is why I don't like DoEvents. It can cause events to be ignored and then posted out of order. If some other control is generating ...
by jvierra
Thu Nov 15, 2018 5:35 am
Forum: PowerShell GUIs
Topic: Powershell studio msgbox close freeze main form
Replies: 7
Views: 152

Re: Powershell studio msgbox close freeze main form

The error is on code that you posted. I just copied it. You must have broken something when copying the code.

See attached.
by jvierra
Thu Nov 15, 2018 4:34 am
Forum: PowerShell GUIs
Topic: Powershell studio msgbox close freeze main form
Replies: 7
Views: 152

Re: Powershell studio msgbox close freeze main form

You can also redo the logic to prevent the overrun you are seeing. $buttonStartProcess_Click={ $script:CancelLoop = $false $buttonCancelProcess.Enabled = $true $this.Enabled = $false $progressbar1.Value = 0 do{ if($script:CancelLoop -eq $true){ $progressbar1.Value = 0 break; } $progressbar1.PerformS...
by jvierra
Thu Nov 15, 2018 4:23 am
Forum: PowerShell GUIs
Topic: Powershell studio msgbox close freeze main form
Replies: 7
Views: 152

Re: Powershell studio msgbox close freeze main form

Remove the DoEvents. It will cause issues when used repeatedly in a loop.
The code is just an experiment. You will not have this issue with real code designed correctly for a form.