Skip to content

ConvertFrom-Base64

SYNOPSIS

Converts a base64 string to a UTF8 string

SYNTAX

1
ConvertFrom-Base64 [-InputString] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The ConvertFrom-Base64 function converts a base64 string to a UTF8 string with the help of [System.Convert]::FromBase64String and [System.Text.Encoding]::UTF8.GetString.

EXAMPLES

EXAMPLE 1

1
2
3
4
5
6
7
$string = '{"importhandler":"myScript.ps1","itemToImport":{"property":[{"property1":"specialCharacters"}]}}'
$enc = [System.Text.Encoding]::UTF8
$stringBytes = $enc.GetBytes($string)
$base64String = [System.Convert]::ToBase64String($stringBytes)
ConvertFrom-Base64 -InputString $base64String

{"importhandler":"myScript.ps1","itemToImport":{"property":[{"property1":"specialCharacters"}]}}

PARAMETERS

-InputString

Base64 string to convert

1
2
3
4
5
6
7
8
9
Type: String
Parameter Sets: (All)
Aliases:

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

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.

The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.

1
2
3
4
5
6
7
8
9
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

None - You cannot pipe objects to this function

OUTPUTS

System.String

NOTES