< Back
ConvertTo-CBase64
Post
NAME ConvertTo-CBase64
SYNOPSIS
Converts a value to base-64 encoding.
SYNTAX
ConvertTo-CBase64 [-Value] <String[]> [[-Encoding] <Encoding>] [<CommonParameters>]
DESCRIPTION
For some reason. .NET makes encoding a string a two-step process. This function makes it a one-step process.
You're actually allowed to pass in `$null` and an empty string. If you do, you'll get `$null` and an empty string
back.
PARAMETERS
-Value <String[]>
The value to base-64 encoding.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Encoding <Encoding>
The encoding to use. Default is Unicode.
Required? false
Position? 2
Default value ([Text.Encoding]::Unicode)
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
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>ConvertTo-CBase64 -Value 'Encode me, please!'
Encodes `Encode me, please!` into a base-64 string.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>ConvertTo-CBase64 -Value 'Encode me, please!' -Encoding ([Text.Encoding]::ASCII)
Shows how to specify a custom encoding in case your string isn't in Unicode text encoding.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>'Encode me!' | ConvertTo-CBase64
Converts `Encode me!` into a base-64 string.
RELATED LINKS
ConvertFrom-CBase64
SYNOPSIS
Converts a value to base-64 encoding.
SYNTAX
ConvertTo-CBase64 [-Value] <String[]> [[-Encoding] <Encoding>] [<CommonParameters>]
DESCRIPTION
For some reason. .NET makes encoding a string a two-step process. This function makes it a one-step process.
You're actually allowed to pass in `$null` and an empty string. If you do, you'll get `$null` and an empty string
back.
PARAMETERS
-Value <String[]>
The value to base-64 encoding.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Encoding <Encoding>
The encoding to use. Default is Unicode.
Required? false
Position? 2
Default value ([Text.Encoding]::Unicode)
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
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>ConvertTo-CBase64 -Value 'Encode me, please!'
Encodes `Encode me, please!` into a base-64 string.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>ConvertTo-CBase64 -Value 'Encode me, please!' -Encoding ([Text.Encoding]::ASCII)
Shows how to specify a custom encoding in case your string isn't in Unicode text encoding.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>'Encode me!' | ConvertTo-CBase64
Converts `Encode me!` into a base-64 string.
RELATED LINKS
ConvertFrom-CBase64