Search found 12369 matches

by jvierra
Wed Jul 11, 2018 5:54 am
Forum: PowerShell GUIs
Topic: ColorDialog
Replies: 11
Views: 271

Re: ColorDialog

The following works as expected: $tbxform_Load={ $colors = Import-Clixml d:\Test\settings.clixml $tbxForm.BackColor = [System.Drawing.Color]::FromArgb($colors.Form.BackColor) } $button1_Click={ $colordialog1.ShowDialog() $tbxForm.BackColor = $colordialog1.Color $colors = @{ Form = @{ BackColor = $tb...
by jvierra
Wed Jul 11, 2018 5:31 am
Forum: PowerShell GUIs
Topic: ColorDialog
Replies: 11
Views: 271

Re: ColorDialog

Sorry. I fixed the example so that it saves the string name and not the color object.
by jvierra
Wed Jul 11, 2018 12:26 am
Forum: PowerShell GUIs
Topic: Adding combobox column to DataGridView
Replies: 9
Views: 212

Re: Adding combobox column to DataGridView

Not necessary to do that. Just add the items to the column template as I showed. This only needs to be done once.
by jvierra
Tue Jul 10, 2018 8:04 pm
Forum: PowerShell GUIs
Topic: ColorDialog
Replies: 11
Views: 271

Re: ColorDialog

Ok - I missed the second question. In forms we normally use a config file to persist settings. $colors = @{ Form = @{ Color = $tbxForm.Color.Name BackColor = $tbxForm.BackColor.Name } myTextBox = @{ Color = $myTextBox.Color BackColor = $myTextBox.BackColor.Name } } # to save $colors | Export-Clixml ...
by jvierra
Tue Jul 10, 2018 7:55 pm
Forum: PowerShell GUIs
Topic: ColorDialog
Replies: 11
Views: 271

Re: ColorDialog

Storing the color across sessions...this might help https://trevorsullivan.net/2016/07/25/powershell-environment-variables/ Good luck To clarify - the "BackColor" property is a color object. A color object can be set to a color object and not a string unless that string is the name of one of the en...
by jvierra
Tue Jul 10, 2018 7:02 pm
Forum: PowerShell GUIs
Topic: ColorDialog
Replies: 11
Views: 271

Re: ColorDialog

Use the color and not the name.

$colordialog1.ShowDialog()
$tbxForm.BackColor = $colordialog1.Color
by jvierra
Mon Jul 09, 2018 3:00 pm
Forum: Windows PowerShell
Topic: year and countryname extract
Replies: 22
Views: 365

Re: year and countryname extract

Get-ChildItem $source -FIle | Select-Object *, @{n='year';e={($_.Basename -split '_')[2]}},@{n='Country';e={($_.Basename -split '_')[1]}} Group-Object Year,Country | Select-Object -expand Group | Sort-Object LastWriteTime | Select-Object -First 1 | Move-Item -Destination $destination
by jvierra
Mon Jul 09, 2018 10:24 am
Forum: Windows PowerShell
Topic: year and countryname extract
Replies: 22
Views: 365

Re: year and countryname extract

Remove "Descending. "Skip 1" must be "First 1".
by jvierra
Mon Jul 09, 2018 5:22 am
Forum: PowerShell GUIs
Topic: GUI to install new domain
Replies: 7
Views: 98

Re: GUI to install new domain

help start-job -full
help about_jobs
by jvierra
Mon Jul 09, 2018 5:12 am
Forum: PowerShell GUIs
Topic: GUI to install new domain
Replies: 7
Views: 98

Re: GUI to install new domain

Try installing it as a Job. That will eliminate the effect of the form.