< Back

ConvertTo-Base64UrlEncoding

Sat Jan 11, 2020 12:31 pm

NAME ConvertTo-Base64UrlEncoding



SYNOPSIS

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





SYNTAX

ConvertTo-Base64UrlEncoding [-InputObject] <String> [-Encoding <Encoding>] [-Padding <Char>] [<CommonParameters>]



ConvertTo-Base64UrlEncoding [-Bytes] <Byte[]> [-Padding <Char>] [<CommonParameters>]





DESCRIPTION

This cmdlet takes a string or a byte array and converts it to a base64 url encoded string. If a string

is provided, you can specify the encoding to use to convert it to bytes, this defaults to UTF8.





PARAMETERS

-InputObject <String>

The string to convert to a base64 url encoded string.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Bytes <Byte[]>

The bytes to convert to a base64 url encoded string.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Encoding <Encoding>

The encoding to use to convert the InputObject parameter to a byte array. 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:\\>$Str = "Hello World!"



$Base64UrlStr = $Str | ConvertTo-Base64UrlEncoding



This converts the input string to a base64 url encoded string.











RELATED LINKS