Support Forums

Search found 10622 matches

by jvierra
Sat Apr 15, 2017 6:04 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Consider this: $ix = $listview2.Columns.Add((New-Object System.Windows.Forms.ColumnHeader)) $listview2.Columns[$ix].name = 'Hostname' $listview2.Columns[$ix].Text = 'Hostname' $listview2.Columns[$ix].Width = 150 $listview2.Columns[$ix].TextAlign = 'Center' "AutoComplete" in PowerShell will...
by jvierra
Sat Apr 15, 2017 5:50 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Here is a much easier way to generate columns. $ix = $listview2.Columns.Add((New-Object System.Windows.Forms.ColumnHeader)) $listview2.Columns[$ix].name = 'Hostname' $listview2.Columns[$ix].Text = 'Hostname' $listview2.Columns[$ix].Width = 150 $ix = $listview2.Columns...
by jvierra
Sat Apr 15, 2017 5:33 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

This is the one that works the way you want: Get-ADComputer -Filter * -SearchBase 'OU=DOMUSERS,DC=DOM,DC=LOCAL' | ForEach-Object { $item1 = New-Object System.Windows.Forms.ListViewItem $item1.Text = $_.Name $item1.Name = $_.Name $item1.SubItems.Add('') $item1.SubItems.Add(...
by jvierra
Sat Apr 15, 2017 5:04 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Post the code you actually used.
by jvierra
Sat Apr 15, 2017 4:49 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Without seeing the code that did this I cannot comment.
by jvierra
Sat Apr 15, 2017 4:16 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

You can't add images to a list before you have crated them. You can add them with a keyname and use ImageKey to reference the image.
by jvierra
Sat Apr 15, 2017 4:12 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Here is another way to do thos: function STATUS { Get-ADComputer -Filter * -SearchBase 'OU=DOMUSERS,DC=DOM,DC=LOCAL' | ForEach-Object { $item1 = New-Object System.Windows.Forms.ListViewItem $listview2.Items.Add($item1) $item1.Text = $_.Name $item1.Name = 'Computer' $status = ...
by jvierra
Sat Apr 15, 2017 4:03 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Sorry. Try it this way. function STATUS { Get-ADComputer -Filter * -SearchBase 'OU=DOMUSERS,DC=DOM,DC=LOCAL' | ForEach-Object { $item1 = New-Object System.Windows.Forms.ListViewItem $item1.Text = $_.Name $item1.Name = $_.Name $item1.SubItems.Add('n/a') $item1.SubItems.Add(...
by jvierra
Sat Apr 15, 2017 3:44 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

Here is an example of how to dynamically assign images to a listview. Run it then analyze how the imagelists are built.

You can also assign at design time from files and they will be encoded into the script.
by jvierra
Sat Apr 15, 2017 3:28 am
Forum: PowerShell GUIs
Topic: Listview check Service status and change icon
Replies: 27
Views: 157

Re: Listview check Service status and change icon

All images need to be in the same image list. You reference them by name or index. This line will bring back an array of value: (Get-BitLockerVolume).ProtectionStatus "CLS" serves no purpose in a form. The following is how we would code this: $buttonEvent = { Get-ADComputer -Filter * -Sear...

Go to advanced search