A way to convert an object in excel format similar to convertto-csv #1690
Unanswered
scottm19468
asked this question in
Q&A
Replies: 2 comments 3 replies
-
|
Could you say a bit more. You want to b64 the actual xlsx? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Does this work for you? $Report=Import-Excel ./sales.xlsx
$Report = $Report | Convertto-CSV -NoTypeInformation | Out-String
$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Report)
$B64 = [Convert]::ToBase64String($Bytes) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
When I write automations that send out emails with attachments, I don't like to work with actual files. I tend to take an object and use convertto-csv, then I convert that to base64 to use in a graph API call to send a message with it as an attachment. By doing this, I never need to actually save the file anywhere first. Is there a way to do this with ImportExcel so that I can b64 an xlsx file instead of a CSV? I want to do this in order to add some extra formatting to the file that CSVs don't allow. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions