Questions tagged [group-object]

For questions related to PowerShell's Group-Object cmdlet.

See Group-Object.

10 questions
3
votes
1 answer

Group-Object AsHashTable doesn't work for ScriptProperty

Works: $Names = 1..5 | % { new-object psobject | add-member -Type NoteProperty -Name Name -Value "MyName" -PassThru } | group Name -AsHashTable $Names.MyName Doesn't work: $Names = 1..5 | % { new-object psobject | add-member -Type ScriptProperty…
xinglong
  • 107
  • 1
  • 5
2
votes
1 answer

PowerShell: Import CSV File, Count Group Sizes, And Output To Original File Appending New Column With Counts

I have a test input csv file, as follows: ID;Name;Level 1;Alpha;A 2;Bravo;A 3;Charlie;A 4;Delta;A 5;Echo;A 6;Foxtrot;A 7;Golf;A 1;Hotel;B 2;India;B 3;Juliet;B 1;Kilo;C 2;Lima;C 3;Mike;C 4;November;C 5;Oscar;C and I would like to generate the…
matekus
  • 732
  • 3
  • 12
1
vote
2 answers

Powershell -Rename files from "Group-Object" output

So I have 150 folders with 100's of files named like…
1
vote
1 answer

Powershell Performance tuning for aggregation operation on big delimited files

I have a delimited file with 350 columns. The delimiter is \034(Field separator). I have to extract a particular column value and find out the count of each distinct value of that column in the file. If the count of distinct value is greater or…
TomG
  • 225
  • 2
  • 13
1
vote
1 answer

Data manipulation\deduplication in powershell

Hey I am looking to deduplicate some data and combine columns from a CSV. Can't get my head around how to do it. Here is a sample of the data I am working with: cmmc,stig,descr AC.1.001,SV-205663r569188_rule,The ability to set access permissions and…
0
votes
1 answer

Powershell - Group-Object Expand and Group again

I have a .csv file which I'm grouping on two properties 'DN', 'SKU' and then performing a sum on another property 'DeliQty' This works fine and the sum is reflected back to the group. However I then need to re group just on 'DN' and write out to…
ColinA
  • 29
  • 5
0
votes
1 answer

PowerShell - Expand Group-Object

I want to expand a PowerShell Group Object. But only the first Object. Get-EventLog -Logname system -EntryType "Error" | Group-Object 'InstanceID' | Select-Object Count, Name, @{Name="Message";Expression={$_.Group.Message[0]}} | Format-Table…
Jens1888
  • 21
  • 3
0
votes
2 answers

Powershell script is missing property in result

I am not sure what is wrong with the script. I have a 3 column csv file that consists of Name,Count,Owner. The goal is to get the highest count of each name, then output all 3 columns, however the Owner column is not outputting. I am only getting…
0
votes
1 answer

PowerShell. Group-object usage in one file

I am trying to combine several rows into one, provided that the key cell is the same. And write data from all lines with the same key to the final line. Example Pic **Before** ID | Name | DateTime | Duration | Call_Type …
0
votes
1 answer

Group-Object by numbers dynamically Powershell

I got a file with the following pattern: 10:15:16:290 53123 10:15:16:290 ra-agi Trace: Sending Query Request message to application gateway host. 10:15:16:290 ra-agi Trace: ApplicationGatewayID = 5001 10:15:16:290 ra-agi Trace: InvokeID…
fbe106360
  • 61
  • 5