PathManagerTool 1.0.0-beta.1

This is a prerelease version of PathManagerTool.
dotnet tool install --global PathManagerTool --version 1.0.0-beta.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local PathManagerTool --version 1.0.0-beta.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=PathManagerTool&version=1.0.0-beta.1&prerelease
nuke :add-package PathManagerTool --version 1.0.0-beta.1

Path Manager

Path Manager is a simple tool to manage the PATH environment variable. It provides commands to list, add, save, check duplicates, delete, restore from a JSON file, and find paths containing a certain string.

Installation

The tool installs as a .NET Core global tool. To install it, run the following command:

dotnet tool install --global pathm

Usage

To run the tool, use the following command:

dotnet pathm [command] [options]

The most common options are --user and --system, the target options, which specify whether the command should be applied to the user or system PATH environment variable.

Commands

list

Lists all paths in the user or system PATH environment variable. If you specify both or none, all will be listed.

Usage:

dotnet pathm list --user
dotnet pathm list --system
dotnet pathm list --user --system
dotnet pathm list --color-output --include-target

--color-output: Colorizes the output. --include-target: Includes the target of the symbolic link in the output.

add

Adds a new path to the user or system PATH environment variable.

Usage:

dotnet pathm add "C:\\NewPath" --user
dotnet pathm add "C:\\NewPath" --system
dotnet pathm add "C:\\NewPath"

You can also use ., which will add the current directory to the PATH.

If not any target are specified, it will add to the user PATH.

Note that if you target the system, your cmd prompt must be running as an administrator.

If the path already exists, in either user or system, it will not be added.

save

Saves the paths to a specified JSON file.

Usage:

dotnet pathm save "paths" "C:\\Path1,C:\\Path2" --user
dotnet pathm save "paths" "C:\\Path1,C:\\Path2" --system
dotnet pathm save "paths" "C:\\Path1,C:\\Path2" --user --system

Write the path without any extension, it will automatically be saved as a .json file.

checkdup

Checks for duplicated paths and lists them, indicating whether they are in the user or system PATH environment variable.

Usage:

dotnet pathm checkdup --user
dotnet pathm checkdup --system
dotnet pathm checkdup --user --system

delete

Deletes a specified path from the user or system PATH environment variable.

Usage:

dotnet pathm delete "C:\\PathToDelete" --user
dotnet pathm delete "C:\\PathToDelete" --system
dotnet pathm delete "C:\\PathToDelete" --user --system

restore

Restores paths from a specified JSON file to the user or system PATH environment variable.

Usage:

dotnet pathm restore "paths.json" --user
dotnet pathm restore "paths.json" --system
dotnet pathm restore "paths.json" --user --system

find

Finds and lists paths containing a certain string in the user or system PATH environment variable.

Usage:

dotnet pathm find "substring" --user
dotnet pathm find "substring" --system
dotnet pathm find "substring" --user --system

gitunix

Adds the Git Unix tools to the PATH environment variable, given that git is installed.

Usage:

dotnet pathm gitunix 
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.0-beta.1 43 6/23/2024