external help file | Module Name | online version | schema |
---|---|---|---|
PSCompression-help.xml |
PSCompression |
2.0.0 |
Expands Gzip Base64 compressed input strings.
ConvertFrom-GzipString
-InputObject <String[]>
[-Encoding <Encoding>]
[-Raw]
[<CommonParameters>]
The ConvertFrom-GzipString
cmdlet can expand Base64 encoded Gzip compressed strings using the GzipStream
Class. This cmdlet is the counterpart of ConvertTo-GzipString
.
PS ..\pwsh> ConvertFrom-GzipString H4sIAAAAAAAACstIzcnJ5+Uqzy/KSeHlUuTlAgBLr/K2EQAAAA==
hello
world
!
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!
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
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
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
This cmdlet supports the common parameters. For more information, see about_CommonParameters.
You can pipe Gzip Base64 strings to this cmdlet.
By default, this cmdlet streams strings. When the -Raw
switch is used, it returns a single multi-line string.