I have a query that grabs all the columns from a table then I do some work on it. The problem is I work with the column names for an insert but they are in a different order because of Get-Member. Is there a way to get the property names (column names) and maintain order or re-order the System.Data.DataRow. I must maintain property types.
Commands: $dataColumns = $dataGatherOut | Get-Member -MemberType Property | Select-Object -ExpandProperty Name $dataColumns
Results: PS C:\Windows\system32> $dataColumns
alpha
check
loan
Commands: $dataGatherOut
Results:
check : 1234
loan : Test Values
alpha : 4568
$dataGatherOut.psobject.properties | select -ExpandProperty Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With