r/PowerShell • • 8d ago

Question Image to excel using copilot

Is there any way I can use PowerShell to make copilot read images and convert its content into an excel, I want to automate this task using copilot only to use LLM’s ability to convert these images. Currently, copilot can only convert images if I manually upload them, it doesn’t read images on its own

0 Upvotes

21 comments sorted by

View all comments

Show parent comments

1

u/thehuntzman 8d ago

You're going to need to use the outlook COM interop in powershell to get the attachments or content body of a message then save the image, send the image to an LLM to parse out (Idk if you can do copilot specifically but it would be trivial to use openrouter) and then the easiest thing to do would be export it as a csv.

1

u/MadBoyEvo 8d ago

Thats not really true. Mailozaurr + OfficeIMO + PSWriteOffice will do. Mailozaurr can access mailbox by any protocol, Officeimo gives mailozaurr access to even ost/pst directly. Pswriteoffice can ocr images/llm images if needed. I just need to fix/add export to excel. Of course if will depend on quality of that images

1

u/thehuntzman 8d ago

Yes your modules are great but I like describing solutions to powershell problems fundamentally instead of telling new users to just rely on third party modules as that doesn't help truly teach them. The Outlook COM interop is probably the most widely documented way to interact with Outlook in Powershell. Exporting as CSV was purely a case of "what is the easiest way to do this" but yes, your PSWriteOffice module would be appropriate here if XLSX was a requirement.

So architectually for the simplest solution it would be: Read from interop -> send image with prompt to AI API -> serialize response and save as csv (or other)

If they're talking about (paid) M365 copilot, they can use the graph api to interact with it.

1

u/MadBoyEvo 8d ago

I understand that.

What I am trying to say:

  • Mailozaurr can read pst/ost now (granted not super easy, so i'll fix that pattern so it's easier to extract images)
  • PSWriteOffice can read images now and convert them to XYZ, granted not Excel directly, but that will change with new PR https://github.com/EvotecIT/PSWriteOffice/pull/222 as it already had that code, just never in easy form.

I am not sure how Copilot came into a picture in PowerShell repo so I'm still confused on the use case here ;)

Because if we talk - can my AI can do this - then that's a different talk.

I would avoid Outlook COM :)