Skip to content

Latest commit

 

History

History
126 lines (87 loc) · 2.58 KB

ConvertFrom-GzipString.md

File metadata and controls

126 lines (87 loc) · 2.58 KB
external help file Module Name online version schema
PSCompression-help.xml
PSCompression
2.0.0

ConvertFrom-GzipString

SYNOPSIS

Expands Gzip Base64 compressed input strings.

SYNTAX

ConvertFrom-GzipString
    -InputObject <String[]>
    [-Encoding <Encoding>]
    [-Raw]
    [<CommonParameters>]

DESCRIPTION

The ConvertFrom-GzipString cmdlet can expand Base64 encoded Gzip compressed strings using the GzipStream Class. This cmdlet is the counterpart of ConvertTo-GzipString.

EXAMPLES

Example 1: Expanding a Gzip compressed string

PS ..\pwsh> ConvertFrom-GzipString H4sIAAAAAAAACstIzcnJ5+Uqzy/KSeHlUuTlAgBLr/K2EQAAAA==

hello
world
!

Example 2: Demonstrates how -NoNewLine works

PS ..\pwsh> $strings = 'hello', 'world', '!'

# New lines are preserved when the cmdlet receives an array of strings.
PS ..\pwsh> $strings | ConvertTo-GzipString | ConvertFrom-GzipString

hello
world
!

# When using the `-NoNewLine` switch, all strings are concatenated
PS ..\pwsh> $strings | ConvertTo-GzipString -NoNewLine | ConvertFrom-GzipString

helloworld!

PARAMETERS

-Encoding

Determines the character encoding used when expanding the input strings.

Note

The default encoding is utf8NoBOM.

Type: Encoding
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Utf8
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Specifies the input string or strings to expand.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Raw

Outputs the expanded string as a single string with newlines preserved. By default, newline characters in the expanded string are used as delimiters to separate the input into an array of strings.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters. For more information, see about_CommonParameters.

INPUTS

String

You can pipe Gzip Base64 strings to this cmdlet.

OUTPUTS

String

By default, this cmdlet streams strings. When the -Raw switch is used, it returns a single multi-line string.