Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Help with arrays.

$
0
0

Hello, I am pretty much a beginner and am working on figuring this stuff out. I am a bit stuck so hoping someone can help a bit.

(Edits forthcoming.. trying to add code)

$e1 = Get-content -path C:tempPowershellEmailAddress $e2 = Get-Content -Path C:tempPowershellDisposition $a = @() $item = New-Object PSObject $item | Add-Member -Type NoteProperty -Name 'EmailAddress' -Value $e1 $item | Add-Member -Type NoteProperty -Name 'Disposition' -Value $e2 $a += $item 

Basically, I have 2 files that I have imported. Both files are flat text files that contain one object on each line.

  • File1 is a list of email addresses
  • File2 is a list of values (Like received, sent etc..)

I load them into the array and can see each {} object and can perform $a.EmailAddress & $a.Disposition and see the data in the array. However, I cannot figure out how to make a 1:1 table map of the data. Have it show it as Address1 Value1, Address2 Value2 etc in a table.

I would also like to figure out how to determine how many times emailaddress1 had sends and receives individually since its email address is in the table multiple times (one for each send/receive instance)

Heck even converting it into a proper CSV would probably be enough.

Thanks for your help.

submitted by /u/Gorstag
[link] [comments]

The post Help with arrays. appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles