I can convert an image to base64 encoding, using [convert]::ToBase64String, but that only works with Get-Content as far as I can see.
I want to get the base64 encoded string of an webimage, for example this image: https://i.imgur.com/Ou5sQ2N.png
If I do:
$img = Invoke-WebRequest -Method GET -Uri https://i.imgur.com/Ou5sQ2N.png
[Convert]::ToBase64String($img.Content)
It looks like a base64 string, but something goes wrong there because it creates a second line and it can't be interpreted.
I don't wan't to download the image first, I must execute this on like 50,000 images.
Invoke-RestMethod gives me a lot of strange characters.
Thanks in advance!