Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Powershell functions to split and join binary files fast

Since Technet Gallery is closed, now here.

See Script Center version: Powershell functions to split and join binary files fast.

Now also on Powershell Gallery as part of the SysAdminsFriends module, see here or install with

Install-Module SysAdminsFriends

Project page on github is here.

Description

Two Powershell functions to split and join binary files fast. The functions are using .Net BinaryWriter methods.

If .Net 4 or above is detected, the quick .CopyTo() method is used to join files.

Update

2020-05-03: Split-File can chunk into parts of size > 2GB now

Usage

in the following examples I assume all files are in the current directory

Dot source the functions first:

. .\Split-File.ps1

You can then split a file BigFile.dat with

Split-File "BigFile.dat" 10000000

into parts of 10000000 byte size or to parts of the default size of 100 MB with

Split-File "BigFile.dat"

The generated part files are named BigFile01.dat, BigFile02.dat, BigFile03.dat ...

You can join the part files BigFile01.dat, BigFile02.dat, BigFile03.dat ... to the original file e.g. with

dir BigFile??.dat | Join-File Rebuild.dat

Rebuild.dat is the same file as the original BigFile.dat.