Powershell: Refactor FileSystemContentReaderWriter to support IO Streams

Created on 5 Aug 2019  路  2Comments  路  Source: PowerShell/PowerShell

Summary of the new feature/enhancement

Recently I have been a look at creating a PSProvider that mirrors the robustness of the FileSystemProvider.
In rebuilding the functionality for Get-Content / Set-Content to include features like
Raw, Tail, ReadCount, TotalCount, Delimiter Requires a ton of effort to impliment.

Proposed technical implementation details (optional)

Create a new base class StreamContentReaderWriter

It will pivot off of System.IO.Stream which is a base class for many Stream Class objects including System.IO.FileStream and System.IO.MemoryStream

Example Base Constructor:
public StreamContentReaderWriter(System.IO.Stream stream, Encoding encoding, bool usingByteEncoding, Provider provider, bool isRawStream)

This refactor would allow for many compatable features that PowerShell inately provides also allowing us to pivot off of external tools like Ships or Simplex

Issue-Enhancement WG-Engine-Providers

Most helpful comment

A Zip file PS Provider? Yeah! And if this proposal helps with that, thumbs up!

All 2 comments

Some example usages would be awesome as well, but this sounds like something that would really make working with providers and building providers much easier. :)

A Zip file PS Provider? Yeah! And if this proposal helps with that, thumbs up!

Was this page helpful?
0 / 5 - 0 ratings