< Back

ConvertFrom-Base64UrlEncoding

Sat Jan 11, 2020 12:30 pm

NAME ConvertFrom-Base64UrlEncoding



SYNOPSIS

Converts a base64 url encoded string back to a plain text string or bytes.





SYNTAX

ConvertFrom-Base64UrlEncoding [-InputObject] <String> [-AsBytes] [-Encoding <Encoding>] [-Padding <Char>]

[<CommonParameters>]





DESCRIPTION

This cmdlet takes a base64 url encoded string and converts it back to a plain text

string or a byte array.





PARAMETERS

-InputObject <String>

The string to convert from a base64 url encoded string.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-AsBytes [<SwitchParameter>]

Specifies that the output is returned as a byte array instead of a string.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Encoding <Encoding>

The encoding to use to convert the base64 url encoded string back to a plain text string. This defaults

to UTF8.



Required? false

Position? named

Default value [System.Text.Encoding]::UTF8

Accept pipeline input? false

Accept wildcard characters? false



-Padding <Char>

The character used as padding for the end of the base64 string before escaping, this defaults to '='.



Required? false

Position? named

Default value =

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String





OUTPUTS

System.String





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/27/2018



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$EscapedStr = "SGVsbG8gV29y_bGQhIEhlbG-xvIQ"



$PlainText = $EscapedStr | ConvertFrom-Base64UrlEncoding



This converts the input string back to a plain text string.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$EscapedStr = "SGVsbG8gV29y_bGQhIEhlbG-xvIQ"



$Bytes = $EscapedStr | ConvertFrom-Base64UrlEncoding -AsBytes



This converts the input string back to a decoded byte array.











RELATED LINKS