New-ReadOptions

Synopsis

Creates an object containing differents options that can be used when reading a Zip archive.

Syntax

New-ReadOptions [[-Encoding] <Encoding>] [[-ProgressBarInformations] <Object>] [<CommonParameters>]

Description

It is possible to specify different behavior when reading a Zip archive.

Parameters

-Encoding <Encoding>

Archive encoding type. Possible values are : -ASCII : ASCII characters encoding scheme (7 bits). -BigEndianUnicode : encoding for the UTF-16 format using the big endian byte order. -Default : encoding for the operating system&;39;s current ANSI code page. -Unicode : encoding for the UTF-16 format using the little endian byte order. -UTF32 : encoding for the UTF-32 format using the little endian byte order. -UTF7 : encoding for the UTF-7. -UTF8 : encoding for the UTF-8. . For better portability, the default value (&;39;DefaultEncoding&;39;) is recommended.

Required? False
Position? 0
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ProgressBarInformations <Object>

The use of this parameter creates an event manager for reading operations. When opening large zip archive, you can choose to display a progress bar. The object value of the parameter is builded by the use of the &;39;New-ProgressBarInformations&;39; function.

Required? False
Position? 1
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 (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

None

Outputs

Ionic.Zip.ReadOptions

Notes

Regarding the use of encoding, see the Ionic dll help documentation. If the &;39;-Verbose&;39; parameter is specified, then object of options is configured with an instance of the class &;39;PSIonicTools&;39; : &;39;PSVerboseTextWriter&;39;. The Ionic DLL use it in order to display additional messages during operations on a Zip archives. Presence of the &;39;-Verbose&;39; parameter therefore imposes implicit release of this instance through a call to the &;39;Close()&;39; method on the target archive by this object of options.

Examples

EXAMPLE 1

PS C:\> $ReadOptions=New-ReadOptions

This example creates a read option object with the default values.

EXAMPLE 2

PS C:\> $ReadOptions=New-ReadOptions -Verbose

This example creates a read option object with a default encoding value and a &;39;PSVerboseTextWriter&;39; for the additional views.

EXAMPLE 3

PS C:\> $pbi=New-ProgressBarInformations $ProgressID "Reading in progress  "
$ReadOptions=New-ReadOptions $Encoding $pbi

This example creates a read option object with a default encoding value and a progress bar

EXAMPLE 4

PS C:\> $pbi=New-ProgressBarInformations $ProgressID "Reading in progress "
$ReadOptions=New-ReadOptions $Encoding $pbi  
$ReadOptions.StatusMessageWriter = [System.Console]::Out

This example creates a read option object with a default encoding value and a progress bar. Then we modify directly his &;39;StatusMessageWriter&;39; property in order to display the progression in console and not in the verbose flow.

Related links

Unknown https://psionic.codeplex.com/wikipage?title=New-ReadOptions-EN

PowerShell Support

  • PowerShell 2.0

Operating System Support

  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows Server 2008 all editions
  • Windows Server 2008 R2 all editions
  • Windows Server 2012 all editions
  • Windows Server 2012 R2 all editions

Last edited May 14, 2014 at 2:23 PM by LaurentDardenne, version 1

Comments

No comments yet.