Support Forums

Search found 10169 matches

by jvierra
Thu Jan 12, 2017 8:35 am
Forum: PowerShell GUIs
Topic: Configure datagridview column to handle DateTime
Replies: 4
Views: 30

Re: Configure datagridview column to handle DateTime

The just convert the collection to a data table and assign it and you will have all columns correctly sortable.

$datagidview1.DataSource = ConvertTo-DataTable $col
by jvierra
Thu Jan 12, 2017 8:22 am
Forum: PowerShell GUIs
Topic: Configure datagridview column to handle DateTime
Replies: 4
Views: 30

Re: Configure datagridview column to handle DateTime

Yes. You can only sort a grid that is attached to a datatable or other object collection that has the "IComparable" intereface. Use ConvertTo-DataTable function after creating your object collection: Actually. If you are using the Update com correctly the field should already be a datetime...
by jvierra
Thu Jan 12, 2017 7:53 am
Forum: PowerShell GUIs
Topic: Configure datagridview column to handle DateTime
Replies: 4
Views: 30

Re: Configure datagridview column to handle DateTime

You need to add the collection to a data table and convert the date to a datetime object before you do that.
by jvierra
Thu Jan 12, 2017 5:15 am
Forum: PowerShell GUIs
Topic: Launch xaml script from a winform.
Replies: 3
Views: 45

Re: Launch xaml script from a winform.

You are welcome. I think you would have seen it eventually.
by jvierra
Thu Jan 12, 2017 3:29 am
Forum: PowerShell GUIs
Topic: Launch xaml script from a winform.
Replies: 3
Views: 45

Re: Launch xaml script from a winform.

You forgot to add this at the beginning of your script:

Add-Type -AssemblyName PresentationFramework
by jvierra
Thu Jan 12, 2017 2:45 am
Forum: PowerShell GUIs
Topic: Datagridview too many rows and auto size
Replies: 22
Views: 275

Re: Datagridview too many rows and auto size

Sorry - I didn't copy it correctly:

Code: Select all

$files = Invoke-Command -ComputerName $textbox1.Text -ScriptBlock { dir C:\Windows\logs -File } | Select Name
$datagridview1.DataSource = [collections.arraylist]$files
by jvierra
Wed Jan 11, 2017 3:43 pm
Forum: PowerShell GUIs
Topic: Datagridview too many rows and auto size
Replies: 22
Views: 275

Re: Datagridview too many rows and auto size

You need to do it this way:

Code: Select all

$files = Invoke-Command -ComputerName $textbox1.Text -ScriptBlock { dir C:\Windows\logs -File }
$datagridview1.DataSource = [collections.arraylist]$files
by jvierra
Tue Jan 10, 2017 3:06 am
Forum: PowerShell GUIs
Topic: Excluding Folders/Directories from Get-ChildItem
Replies: 2
Views: 87

Re: Excluding Folders/Directories from Get-ChildItem

Simple:

Get-ChildItem -Path $path -File
by jvierra
Mon Jan 09, 2017 1:26 pm
Forum: PowerShell GUIs
Topic: Works in PowerShell not in PSStudio
Replies: 7
Views: 138

Re: Works in PowerShell not in PSStudio

Code: Select all

$adapt = Get-WmiObject Win32_NetworkAdapterConfiguration -Filter "Caption LIKE '%Ethernet%'"
$adapt.EnableStatic($IPAddess,$SubnetMask)


help Get-WmiObject -Full
by jvierra
Mon Jan 09, 2017 12:52 pm
Forum: PowerShell GUIs
Topic: Works in PowerShell not in PSStudio
Replies: 7
Views: 138

Re: Works in PowerShell not in PSStudio

This will fix at least one obvious issue.

Code: Select all

"netsh interface ipv4 set address ""Ethernet"" static $($textbox13.Text) $($textbox22.Text) $($textbox21.Text)"

Go to advanced search