Its pretty straightforward to get the first x lines of a text file, but I need the first x MB of a file. Given that I'm a PowerShell neophyte if you could please give me some annotations on the script that would be greatly appreciated.
Get-Content foo.exe -TotalCount 1MB -Encoding byte
If you happen to be using PowerShell Community Extensions then do this:
Format-Hex foo.exe -count 1MB
Note: If you are using PowerShell V2 be sure to grab the 1.2 beta of PSCX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With