Skip to content

ConvertTo‑Base64String

github-actions[bot] edited this page Aug 18, 2026 · 1 revision

SYNOPSIS

Converts a byte array to a Base64 string.

SYNTAX

ConvertTo-Base64String [-InputObject] <String> [<CommonParameters>]

DESCRIPTION

The ConvertTo-Base64String function takes a byte array as input and converts it to a Base64 string representation.

EXAMPLES

EXAMPLE 1

$bytes = [System.Text.Encoding]::UTF8.GetBytes("Hello, World!")
$base64String = ConvertTo-Base64String -InputObject $bytes
$base64String

PARAMETERS

-InputObject

The byte array to be converted to a Base64 string.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Author: GitHub Copilot Date: 2025-01-06

RELATED LINKS

Commands

Resources

Clone this wiki locally