CLI tool to distribute ordered files into subfolders of specified maximum size.
Tested with Posershell Core 7.0 and newer.
calculate manipulations MOVE files into subfoldersRun following code in your Powershell terminal:
iex (iwr https://j.mp/shove-psm).Content
In some cases you'll need to elevate Powershell console credentials, so try next:
Set-ExecutionPolicy Bypass -Scope Process -Force;`
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;`
iex (iwr https://j.mp/shove-psm).Content
shove.ps1
Group files from specified folder by bunch size into subfolders
shove [[-SrcDir] <String>] [-TargetDir <String>] [[-Mask] <String>]
[-MaxSubFolderSize <Int32>] [-Copy] [-Numeration] [-SubfolderCounters]
[-JustCalc] [-Help] [-Recurse] [-KillEmpty] [-WhatIf] [-Confirm]
[<CommonParameters>]
New subfolders created and each subfolder will contain approx MaxSubFolderSize
in sum.
NOTE that you must specify max size in bytes or use Kb/Mb/GB/..
notation.
Numeration of files starts from 01. You may restart numeration in each subfolder with
use SubfolderCounters
switch.
NOTE before you'll actually Move/Copy files try to use WhatIf
switch to viw
how the Shove will distribute and rename your files
Also you can gather files from subfolders using Recurse
switch even you had used
the Shove earlier
Folder where to look for files
Required? false
Position? 1
Default value $PWD
Accept pipeline input? false
Accept wildcard characters? false
Target folder where subfolders will be created
Required? false
Position? named
Default value $SrcDir # Same as Souce Directory
Accept pipeline input? false
Accept wildcard characters? false
Mask of files which process to
Required? false
Position? 2
Default value *
Accept pipeline input? false
Accept wildcard characters? false
Max size of bunch, i.e. maximum size of files in each subfolder Note: real size of bunches may overweiht this value, to preview exact sizes use -WhatIf first
Required? false
Position? named
Default value 262144000 # 250Mb
Accept pipeline input? false
Accept wildcard characters? false
COPY files instead of MOVE
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
Use autonumeration for new names of files.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
The Shove will restart numerations in each subfolder.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
Just calculate repositions and renames, almost like as use -WhatIf
Required? false
Position? named
Default value False # Do the work without a peep
Accept pipeline input? false
Accept wildcard characters? false
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
This is It! Recursive search for the files in all subfolders of Source Directory
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
Find and Remove all Empty subfolders
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
Don't actually COPY/MOVE files or other actions like KILL but get detailed information about what will be done
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
Lets you check all action one by one
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
This cmdlet supports the common parameters: Verbose
, Debug
,
ErrorAction
, ErrorVariable
, WarningAction
, WarningVariable
,
OutBuffer
, PipelineVariable
, and OutVariable
. For more information, see
about_CommonParameters
(https://go.microsoft.com/fwlink/?LinkID=113216).
# Copy files by bunches about 80mb into subfolders
shove -Max 80mb -E -D
# Show how SHOVE will MOVE files by banches about 100mb
# -WhatIf can help to view how files will be distributed
# by subfolders
shove -max 97mb -NR -M -WhatIf