PowerShell scripts that automate preparing GOG and Steam games for GameVault by compressing them into .7z archives that follow GameVault's required naming format.
Interactive script that prompts you for game metadata (title, version, release year, game type, etc.) and compresses each game folder into a properly named .7z archive. Use this when your source folders are not yet named per GameVault conventions.
Batch compression script for game folders that are already named per GameVault conventions. Compresses every validly-named folder using maximum compression with no prompts. Runs an integrity check (7z t) on existing archives before skipping them; corrupt archives are automatically rebuilt. Supports parallel compression via -Parallel for multi-drive setups.
- Supports both GOG and Steam game sources
- Compresses game folders using 7-Zip
- Follows GameVault's naming convention requirements
- Supports all GameVault metadata tags (Early Access, Game Type, No Cache)
- Automatically creates destination directories if needed
- Resolves all paths relative to the script (
$PSScriptRoot), so the repo can live anywhere - Auto-detects 7-Zip in standard install locations and on
PATH; supports aSEVENZIP_PATHenv-var override - Compresses with multithreading enabled (
-mmt=on) for faster runs on multi-core CPUs Compress-ForGameVault.ps1pre-flights folder names against GameVault format; invalid names are reported and skipped before compression startsCompress-ForGameVault.ps1integrity-tests existing archives with7z tbefore skipping; corrupt archives are rebuilt automaticallyCompress-ForGameVault.ps1supports configurable source directories via-Sourceshashtable (add Itch, Epic, etc. without forking)Compress-ForGameVault.ps1supports optional parallel compression (-Parallel, PS 7+ only)Prepare-GamesForGameVault.ps1sanitizes user-typed titles to strip characters Windows forbids in filenamesPrepare-GamesForGameVault.ps1parses existing folder names to pre-fill all metadata prompts — just press Enter to accept- Both scripts emit
GameVault-Ready\manifest.csv(name, source, sizes, compression ratio, duration, optional SHA-256) - Both scripts support
-WhatIffor dry-run and accept-SevenZipPath,-DestinationDir, and other path overrides as parameters
- Windows with PowerShell 5.1+ (or PowerShell 7+)
- 7-Zip — keep on the latest stable release for security fixes
- GOG and/or Steam games in source directories
- For GOG offline installers: ensure all installer files for a given game live inside a folder named after the game (e.g.
Fallout 2, notFALLOUT_2-1998)
-
Clone this repository or download the scripts
-
Install 7-Zip. The scripts auto-discover it in this order:
$env:SEVENZIP_PATHif setC:\Program Files\7-Zip\7z.exeC:\Program Files (x86)\7-Zip\7z.exe7z.exeonPATH
If 7-Zip lives somewhere non-standard, set the override before running:
$env:SEVENZIP_PATH = "D:\Tools\7-Zip\7z.exe"
-
Place your game folders in the appropriate source directories alongside the scripts:
GOG-Archive\— GOG game foldersSteam-Archive\— Steam game folders
GameVault-GamePrep\
├── Prepare-GamesForGameVault.ps1
├── Compress-ForGameVault.ps1
├── GOG-Archive\
│ └── Fallout 2\
│ └── ...installer files...
├── Steam-Archive\
│ └── Half-Life 2\
│ └── ...game files...
└── GameVault-Ready\ # created automatically
└── Fallout 2 (W) (1998).7z
Use this when your folders are not yet named per GameVault conventions.
- Open PowerShell
- Navigate to the script directory
- Run the script:
.\Prepare-GamesForGameVault.ps1- Choose a session-wide default compression level (can override per game)
- For each game: press Enter to process, s to skip, or q to quit. If the folder name already follows GameVault conventions, all metadata prompts are pre-filled — just press Enter to accept
- Title input is sanitized automatically. Game-type is validated; invalid values reprompt. Year is validated against the range 1970–(current year + 1)
- Compressed archives are saved to
GameVault-Ready\; a row is appended toGameVault-Ready\manifest.csvafter each success
Use this when your folders are already named per GameVault conventions. Each archive is named <FolderName>.7z verbatim, so the source folder name must end with a 4-digit year in parentheses (e.g. Fallout 2 (W) (1998)). Folders that don't match this format are reported and skipped before any compression begins.
- Open PowerShell
- Navigate to the script directory
- Run the script:
.\Compress-ForGameVault.ps1- All validly-named folders in the source directories are compressed to
GameVault-Ready\using maximum compression; a row is appended toGameVault-Ready\manifest.csvafter each success - Folders whose archive already exists are integrity-tested with
7z tbefore being skipped. Corrupt archives are deleted and rebuilt. Pass-SkipIntegrityCheckto skip the test, or-Forceto always re-archive - Folders missing the required
(YYYY)suffix are reported and skipped — rename them or runPrepare-GamesForGameVault.ps1to handle them interactively
Prepare-GamesForGameVault.ps1 builds filenames following GameVault's required format:
Title (Version) (EarlyAccess) (GameType) (NoCache) (ReleaseYear).7z
Where:
- Title — name of the game
- Version — optional version number (e.g.
v1.2.3) - EarlyAccess —
EAtag for early access games - GameType — game platform type:
W_S— Windows StoreW— WindowsL— LinuxM— MacA— Android
- NoCache —
NCtag to disable caching - ReleaseYear — required 4-digit year of release
Example: Hades (v1.38209) (W) (2020).7z
For full details, see the GameVault file naming docs.
Prepare-GamesForGameVault.ps1 offers three compression levels:
| Choice | 7-Zip flags | Notes |
|---|---|---|
1 Fast |
-mx=0 -ms=off |
Store only (no compression). Fastest, largest output. |
5 Balanced |
-mx=5 -mmt=on |
Default. Good balance of size vs. speed. |
9 Maximum |
-mx=9 -mfb=64 -md=32m -ms=on -mmt=on |
Smallest output, slowest. |
Compress-ForGameVault.ps1 always uses maximum compression (-mx=9 -mfb=64 -md=32m -ms=on -mmt=on).
Final archives land in GameVault-Ready\. Copy them to your GameVault server's /files directory (or your configured ingest path) for import.
Each successful compression appends a row to GameVault-Ready\manifest.csv:
| Column | Description |
|---|---|
CompletedAt |
ISO-8601 timestamp |
Name |
Archive filename (without .7z) |
Source |
Source label (e.g. GOG, Steam) |
SourceBytes |
Uncompressed folder size |
ArchiveBytes |
Final archive size |
CompressionRatio |
ArchiveBytes / SourceBytes |
DurationSeconds |
Elapsed compression time |
SHA256 |
SHA-256 of archive, or empty if -EmitSha256 not passed |
Both scripts accept these parameters (all have sensible defaults):
| Parameter | Type | Default | Description |
|---|---|---|---|
-Sources |
hashtable |
@{ GOG=…; Steam=… } |
Map of Label → SourceDir. Add any number of sources without forking. |
-DestinationDir |
string |
.\GameVault-Ready |
Output directory for archives and manifest. |
-SevenZipPath |
string |
auto-detected | Path to 7z.exe. Overrides $env:SEVENZIP_PATH. |
-Force |
switch |
off | Re-archive even when a .7z already exists. |
-SkipIntegrityCheck |
switch |
off | Skip 7z t test on existing archives before deciding to skip. |
-Parallel |
switch |
off | Fan out compressions across runspaces (PS 7+ only). |
-ThrottleLimit |
int |
2 |
Max concurrent jobs when -Parallel is set. |
-EmitSha256 |
switch |
off | Compute and record SHA-256 of each archive in the manifest. |
-WhatIf |
switch |
off | Dry-run: report what would be compressed without writing. |
# Example: custom sources, parallel, 3 threads
.\Compress-ForGameVault.ps1 -Sources @{ GOG='D:\GOG'; Itch='E:\Itch' } -Parallel -ThrottleLimit 3| Parameter | Type | Default | Description |
|---|---|---|---|
-GogSourceDir |
string |
.\GOG-Archive |
Path to GOG game folders. |
-SteamSourceDir |
string |
.\Steam-Archive |
Path to Steam game folders. |
-DestinationDir |
string |
.\GameVault-Ready |
Output directory for archives and manifest. |
-SevenZipPath |
string |
auto-detected | Path to 7z.exe. Overrides $env:SEVENZIP_PATH. |
-EmitSha256 |
switch |
off | Compute and record SHA-256 of each archive in the manifest. |
-WhatIf |
switch |
off | Dry-run: report what would be compressed without writing. |
Keep 7-Zip on the latest stable release. Older builds have known CVEs; check 7-zip.org for the current version.
Released under the MIT License.
Issues and pull requests welcome. For larger changes, open an issue first to discuss the approach.