Thursday, April 25, 2024
HomePowershellArchive Module 2.0 Preview 1

Archive Module 2.0 Preview 1


We’re excited to announce that the primary preview of a rewrite of Microsoft.PowerShell.Archive, the module that permits you to create and extract archives, is now out there on the PowerShell Gallery.

This launch is the primary preview launch of a rewrite of the module and isn’t function full. Please word that this launch solely incorporates the Compress-Archive cmdlet and is simply appropriate with PowerShell 7.3.0-preview5 and up. For extra data on what’s proposed on this rewrite, or to present suggestions on the design please consult with the RFC.

Objectives of the two.0 launch

The aim for the Archive module is to construct a high-performing and maintainable module that gives excessive utility and works cross-platform (particularly with regard to file paths).

At present, the archive module has numerous limitations. The module helps the zip32 format solely. .NET 7 is deliberate to assist the tar archive format, so there is a chance to assist a further archive format by making the most of these new APIs. In the meantime, this chance will be leveraged not solely so as to add tar assist, however to rewrite the whole module in C# and handle present usability points.

The module has restricted efficiency in comparison with different archive software program. Though efficiency is dictated by the .NET APIs, a rewrite of the module in C# can cut back the overhead from script modules and handle efficiency points to an extent.

The module has restricted cross-platform assist as a result of archive entries are written in an OS-specific approach as a consequence of totally different characters getting used as listing separators in numerous OSs. This makes it tough for Unix-based OS customers to make use of archives compressed on a Home windows pc or vice versa. The rewrite of the module can resolve this drawback by normalizing all paths to make use of Unix listing separators (the ‘/’ character) throughout all platforms.

There are a variety of points in regard to utilizing wildcard characters in paths. For instance, in some circumstances, wildcard characters are usually not interpreted actually, which makes it tough to make use of paths containing wildcard characters to specify the placement of the archive.

In some circumstances, error reporting will be improved and extra descriptive. Compatibility with different archive software program can be improved as there are circumstances the place an archive program could not acknowledge an archive produced by this module as legitimate. Interactions with different components of PowerShell, such because the job system, superior capabilities, and customary parameters will be additional improved, in order that customers can have a seamless expertise when utilizing the module.

Moreover, .NET has supported creating giant archives and compressing giant information, however the archive module has lacked assist for this. It is sensible to assist archive codecs which might be supported by .NET, resembling zip64 and tar, and to offer choices that .NET additionally offers. The subsequent model of the archive module, Microsoft.PowerShell.Archive v2.0.0, plans on resolving these limitations and usefulness points.

Putting in the module

Please word that this launch will solely work with PowerShell 7.3.0-preview5 and up. Discover and set up the newest preview model of PowerShell right here.

To put in the Microsoft.PowerShell.Archive 2.0 preview 1 run the next command

Set up-Module Microsoft.PowerShell.Archive -AllowPrerelease

Options of the discharge

This launch isn’t function full and solely incorporates the rewrite of the Compress-Archive cmdlet.

This cmdlet incorporates two parameter units

    Compress-Archive [-Path] <string[]> [-DestinationPath] <string> [-WriteMode  Update ] [-PassThru] [-CompressionLevel  SmallestSize] [-Format {zip}] [-WhatIf] [-Confirm] [<CommonParameters>]

    Compress-Archive [-LiteralPath] <string[]> [-DestinationPath] <string> [-WriteMode  Update ] [-PassThru] [-CompressionLevel  NoCompression ] [-Format {zip}] [-WhatIf] [-Confirm] [<CommonParameters>]

Some options to notice of this launch

  • Help for zip32 & zip64
  • Preserves relative path construction (when relative paths are specified)
  • Improved efficiency from earlier variations of the cmdlet
  • New -WriteMode assist in case of vacation spot path collisions

Options of the subsequent launch

The subsequent launch will focus within the Increase-Archive cmdlet. To trace the progress of this launch, take a look at this undertaking in our GitHub repository.

Giving Suggestions and Getting assist

Whereas we hope the brand new implementation offers a significantly better consumer expertise, there are sure to be points. Please tell us in case you run into something.

For those who encounter any points with the module or have function requests, one of the best place to get assist is thru our GitHub repository.

Abdullah Yousuf

Sydney Smith

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments