Skip to content

ConvertFrom-Base64

SYNOPSIS

Decodes a base64-encoded string or array of strings into UTF-8 strings.

SYNTAX

ConvertFrom-Base64 [-Base64String] <String[]> [[-Encoding] <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Converts a base64-encoded string or array of strings into human-readable UTF-8 strings. The function accepts input from the pipeline and validates the input using the Test-Base64 function before decoding.

EXAMPLES

EXAMPLE 1

"U29tZSBkYXRh" | ConvertFrom-Base64

Output:

Some data

Decodes the base64-encoded string "U29tZSBkYXRh" into its original UTF-8 representation.

EXAMPLE 2

@("SGVsbG8=", "V29ybGQ=") | ConvertFrom-Base64

Output:

Hello
World

Decodes each base64-encoded string in the array into its original UTF-8 representation.

PARAMETERS

-Base64String

The base64-encoded string or array of strings to be decoded.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-Encoding

The encoding to use when converting the string to bytes.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: UTF8
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

System.String

NOTES

The decoded UTF-8 string(s).

https://psmodule.io/Base64/Functions/ConvertFrom-Base64/