Project

ImagePlayground

Automate image processing, codes, metadata, charts, topology, and visual stories from PowerShell.

Stars 101
Forks 7
Total downloads 711,982
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-10-26
Command

ConvertTo-ImageBase64

Module
ImagePlayground
Inputs
System.String
Outputs
System.String

Converts an image file into a Base64 encoded string.

Syntax

ConvertTo-ImageBase64
[-FilePath] <String>
[<CommonParameters>]
#
Parameter set: All Parameter Sets

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

Parameters

-FilePath String requiredposition: 0pipeline: True (ByValue)
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.