API Reference
Command
ConvertTo-ImageBase64
Converts an image file into a Base64 encoded string.
Remarks
Converts an image file into a Base64 encoded string.
Examples
Get a Base64 string from an image
ConvertTo-ImageBase64 -FilePath in.png
Inline conversion and upload
$b64 = ConvertTo-ImageBase64 -FilePath photo.jpg; Invoke-RestMethod -Uri https://example/upload -Body $b64
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.
Syntax
ConvertTo-ImageBase64 -FilePath <String> [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- FilePath String
- Path to the image to convert.
Outputs
System.String