< Back

Invoke-Base64UrlUnescape

Sat Jan 11, 2020 12:32 pm

NAME Invoke-Base64UrlUnescape



SYNOPSIS

Performs character unescaping on a string that is already base64 encoded and has already been escaped.





SYNTAX

Invoke-Base64UrlUnescape [-InputObject] <String> [-Padding <Char>] [<CommonParameters>]





DESCRIPTION

This cmdlet takes an input and unescapes url characters, changing - to + and _ to /. The appropriate amount

of trailing padding is also added back.





PARAMETERS

-InputObject <String>

The base64 string to unescape.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Padding <Char>

The character that will be used for any necessary trailing padding. 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"



$Base64Str = $EscapedStr | Invoke-Base64UrlUnescape



The escaped string will be "SGVsbG8gV29y/bGQhIEhlbG+xvIQ==".











RELATED LINKS