Command
ConvertTo-ImageBase64
Converts an image file into a Base64 encoded string.
Syntax
ConvertTo-ImageBase64
[-FilePath] <String>
[<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Get a Base64 string from an image
ConvertTo-ImageBase64 -FilePath in.pngInline conversion and upload
$b64 = ConvertTo-ImageBase64 -FilePath photo.jpg; Invoke-RestMethod -Uri https://example/upload -Body $b64Parameters
- -FilePath String
- Path to the image to convert.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.