A PowerShell module to manage the PATH environment variable on Windows.
This module only supports Windows operating systems.
To install the module simply run the following command in a PowerShell terminal.
Install-PSResource -Name PATH
Import-Module -Name PATH
You can use the module to Get, Add, Remove and Repair the PATH environment variable.
The Get-EnvironmentPath
cmdlet returns the PATH environment variable.
Get-EnvironmentPath
To get the PATH environment variable for the system, use the -Scope AllUsers
parameter.
Get-EnvironmentPath -Scope AllUsers
The Add-EnvironmentPath
cmdlet adds a directory to the PATH environment variable.
Add-EnvironmentPath -Path 'C:\Program Files\MyApp'
To add a directory to the PATH environment variable for the system, use the -Scope AllUsers
parameter.
Add-EnvironmentPath -Path 'C:\Program Files\MyApp' -Scope AllUsers
The Remove-EnvironmentPath
cmdlet removes a directory from the PATH environment variable.
Remove-EnvironmentPath -Path 'C:\Program Files\MyApp' # Tab completion is supported
To remove a directory from the PATH environment variable for the system, use the -Scope AllUsers
parameter.
Remove-EnvironmentPath -Path 'C:\Program Files\MyApp' -Scope AllUsers
The Repair-EnvironmentPath
cmdlet repairs the PATH environment variable by removing duplicate entries and non-existing directories.
Repair-EnvironmentPath
To repair the PATH environment variable for the system, use the -Scope AllUsers
parameter.
Repair-EnvironmentPath -Scope AllUsers
Coder or not, you can contribute to the project! We welcome all contributions.
If you don't code, you still sit on valuable information that can make this project even better. If you experience that the product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests. Please see the issues tab on this project and submit a new issue that matches your needs.
If you do code, we'd love to have your contributions. Please read the Contribution guidelines for more information. You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement.