Comments (2)
Compare with proof of concept Split-Content
$foo = Split-Content -LiteralPath 'foo.bar' -AsByteStream -ReadCount 3
$foo.GetType().Name
$foo[0].GetType().Name
$foo.Count
$foo[0].Count
$foo[1].Count
Gives list of byte arrays
Object[]
Byte[]
2
3
3
from powershell.
I support this feature request, but let me add some context:
-
If
-ReadCount
is specified,-Raw
is ignored (which is unfortunate, and arguably a bug). -
-Raw
in combination with-AsByteStream
- but without-ReadCount
- does emit a[byte[]]
array, but it invariably means reading the whole input file into memory. -
-ReadCount
- wich currently emits[object[]]
arrays - should:- emit
[string[]]
arrays by default - if
-AsByteStream
is also specified, should emit[byte[]]
arrays
- emit
In other words: when "chunking" is requested via -ReadCount
a strongly typed array should be returned, which helps performance, especially in v7.4+ with -AsByeStream
, which then allows directly outputting chunked byte data to an external (native) program (which only works with [byte[]]
arrays, not with [object[]]
arrays).
This is technically a breaking change, but most likely one that falls into bucket 3.
from powershell.
Related Issues (20)
- Invoke-WebRequest fails with โRequest headers must contain only ASCII characters.โ for simple requests HOT 2
- [JEA] Register-PSSessionConfiguration does not "cascade" the -NoServiceRestart parameter to Set-PSSessionConfiguration when automatically calling it.
- Feature: Expose `Set-Location` history stack HOT 11
- Surrogate pairs cause misalignment in Format-Wide HOT 16
- Update behavior for getting wix 3.14 in CI.psm1 HOT 1
- is it defined/documented which newlines are used by Write-Host and Out-File HOT 8
- `Remove-Item` throws "Attempted to divide by zero" on PS 7.5.0-preview.3 HOT 6
- `using namespace` overrides previous `using namespace` uses as interactive HOT 8
- [Windows] No error when using a non-executable file in script line HOT 4
- `Remove-Item` reports incorrect number of removed items in the progress bar HOT 1
- Bug - PowerShell displays an error when loading in Windows Terminal HOT 5
- Show payload being sent when using verbose with Invoke-RestMethod and Invoke-WebRequest HOT 2
- Encode spaces with %20 instead of + when using Invoke-RestMethod and Invoke-WebRequest. HOT 15
- "foreach" alias poorly named, does not reproduce functionality and use cases with ForEach-Object HOT 7
- PowerShell community Power BI dashboard - Colors of Linux and MacOS are the same in graphs HOT 4
- pwsh 7.4.2 no-input unhandled exception -> process exit HOT 4
- CreateOutOfProcessRunspace fails to Open HOT 1
- `exit` does not return ExitCode when using #Requires -Module <ScriptModule> HOT 1
- pwsh Exception not serializable anymore HOT 5
- `Using Script` directive HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powershell.