Tool Fetcher
A Simple Way to Fetch and Manage Your Favorite Tools
If you find yourself frequently downloading and managing the same set of tools across different machines, ToolFetcher is here to streamline that process. I built this tool to automate downloading essential forensic, security, and incident response utilities from trusted sources, saving time and ensuring consistency.
In this post, I’ll walk you through what ToolFetcher is, how to use it, and how you can create custom YAML files for your own set of commonly used tools.
What is ToolFetcher?
ToolFetcher is a lightweight PowerShell script that reads a YAML file containing tool definitions and automatically downloads them to your machine. It supports downloading from URLs and even unpacking compressed files to keep your tool-set organized.
Why Use ToolFetcher?
- Automation: No need to manually search for and download tools.
- Consistency: Maintain the same, updated tool versions across multiple systems.
- Customization: Define your own YAML file to specify which tools you need.
- Organization: Customize how you want to organize your tool-set.
Getting Started
Requirements
PowerShell: Version 5.1 or later (or PowerShell Core).
powershell-yaml Module: This module is required to parse the external YAML configuration file. The script automatically checks for and installs it (if necessary).
Installation
ToolFetcher requires PowerShell. Install it by cloning the repository:
git clone https://github.com/kev365/ToolFetcher.git
cd ToolFetcher
Running ToolFetcher
Once installed, simply run the script with a YAML file containing your tool definitions. By default, ToolFetcher will download all enabled tools.
Method 1:
.\ToolFetcher.ps1
Method 2:
.\ToolFetcher.ps1 -ToolsFile tools.yaml
Method 1 uses either:
- The tools.yaml file that comes with it, so long as it’s in the same folder as the script itself. This can be set in the $ToolsFile variable of the script, as well.
- It can utilize shared yaml files placed in GitHub, with the appropriate link. Example: https://raw.githubusercontent.com/kev365/ToolFetcher/refs/heads/main/tools.yaml
Method 2 allows you to manually specify your own yaml file on your local system.
Creating Your Own YAML File
You can customize ToolFetcher to download your own set of tools by defining them in a YAML file. Here’s a basic example:
tools:
# -----------------------------------------------------
# Example for gitClone – Clones a Git repository.
# This example clones the repository from the given URL,
# checking out the "main" branch.
# -----------------------------------------------------
- Name: "ExampleGitClone"
RepoUrl: "https://github.com/username/example-git-clone"
DownloadMethod: "gitClone"
Branch: "main" # Specify the branch you want to clone.
OutputFolder: "GitTools" # Local folder where the tool will be saved.
# -----------------------------------------------------
# Example for latestRelease – Downloads the latest release asset via the GitHub API.
# This example downloads a specific asset (e.g., a ZIP file) from the latest release.
# -----------------------------------------------------
- Name: "ExampleLatestRelease"
RepoUrl: "https://github.com/username/example-latest-release"
DownloadMethod: "latestRelease"
DownloadName: "example-tool.zip" # The asset file name to download.
OutputFolder: "ReleaseTools"
# -----------------------------------------------------
# Example for branchZip – Downloads a branch ZIP archive (without the .git folder).
# This example fetches a ZIP archive for the specified branch (here, "develop").
# -----------------------------------------------------
- Name: "ExampleBranchZip"
RepoUrl: "https://github.com/username/example-branch-zip"
DownloadMethod: "branchZip"
Branch: "develop" # The branch from which to download the ZIP archive.
OutputFolder: "BranchZipTools"
# -----------------------------------------------------
# Example for specificFile – Downloads a specific file directly.
# This example downloads a single file. If the RepoUrl is a GitHub URL,
# the tool will convert it to use the raw file URL based on SpecificFilePath.
# -----------------------------------------------------
- Name: "ExampleSpecificFile"
RepoUrl: "https://github.com/username/example-specific-file"
DownloadMethod: "specificFile"
SpecificFilePath: "/raw/refs/heads/main/example.exe" # Path to the file in the repository.
OutputFolder: "SpecificFileTools"
Common YAML Options
Name (required):
The identifier for your tool. This value is used in logging and to create unique output folders.
RepoUrl (required):
The URL of the tool’s repository or the direct URL for a downloadable file.
DownloadMethod (required):
Defines how ToolFetcher downloads the tool. Options include:
gitClone
– Clones the entire Git repository.latestRelease
– Downloads the latest release asset from GitHub using its API.branchZip
– Downloads a ZIP archive of a specific branch (without the.git
folder).specificFile
– Downloads a single, specific file directly.
OutputFolder (optional):
The folder (or subfolder) where the tool will be stored locally. Use this to help organize your tools, if you like. It functions to append a sub-directory to the $toolsFolder variable.
Branch (optional):
For gitClone
and branchZip
methods, this specifies which branch to use. Defaults to "master"
if not provided.
DownloadName or AssetFilename (optional):
For latestRelease
, if the GitHub release contains multiple assets, you can specify the exact asset file name to download.
AssetType (optional):
Also for latestRelease
—this allows you to select an asset using predefined regex patterns (see asset pattern matching below).
SpecificFilePath (optional):
Used with the specificFile
method to point to the exact path of the file to download (commonly used with GitHub URLs, which the tool will convert to the raw file URL).
Extract (optional):
Boolean value (true
by default) that tells the script whether to automatically extract ZIP archives after downloading. Set it to false
if you prefer to handle the extraction manually.
skipdownload (optional):
When set to true
, this flag tells ToolFetcher to skip processing and downloading this tool—useful for temporarily disabling a tool.
Asset Pattern Matching and Usage
When using the latestRelease
method, ToolFetcher can automatically select the proper release asset by matching its name against a set of predefined regular expression patterns. These patterns are defined in the script as follows:
win64:
Matches Windows 64-bit assets (e.g., "win64"
, "Windows_x64"
, "amd64"
).
Example Regex: (?i)win(?:dows)?[-_](x64|amd64)(?)
win32:
Matches Windows 32-bit assets (e.g., "win32"
, "x86"
).
Example Regex: (?i)(win(dows)?).*?(32|x86)
linux:
Matches assets intended for Linux systems.
Example Regex: (?i)(linux|lin)
macos:
Matches macOS assets (e.g., "mac"
, "osx"
, "darwin"
).
Example Regex: (?i)(mac|osx|darwin)
How to use AssetType:
If you specify the AssetType
key in your YAML configuration (e.g., AssetType: "win64"
), ToolFetcher will filter the list of assets from the latest GitHub release using the corresponding regex pattern. This is particularly useful when a release offers multiple assets for different platforms. If no matching asset is found, or if you provide an invalid type, the script logs a warning.
Tip: If you have a specific asset name, consider using DownloadName
or AssetFilename
to bypass regex matching entirely.
Final Comments
ToolFetcher is designed to be extensible, I’d love to hear your feedback or feature requests. Feel free to fork the repo, submit PRs, or report issues on GitHub.
Connect
LinkedIn: https://www.linkedin.com/in/dfir-kev/