Power Shell
Add an executable to the Path
To add an executable to PowerShell's path, you'll need to update the PATH environment variable. Here are the steps:
Method 1: Using the PATH Environment Variable (Temporary)
You can update the PATH variable for the current PowerShell session by running:
$env:PATH += ";C:\Path\To\Executable"
Replace C:\Path\To\Executable
with the actual path to the executable you want to add.
Note: This change is only temporary and will be lost when you close the PowerShell session.
Method 3: Using a PowerShell Profile
You can also update the PATH variable by adding a line to your PowerShell profile. This method is useful if you want to keep your environment variables separate from your system settings.
-
Open your PowerShell profile file (usually located at
C:\Users\<YourUsername>\Documents\WindowsPowerShell\profile.ps1
). -
Add the following line:
$env:PATH += ";C:\Path\To\Executable"
-
Save the file and restart PowerShell.
Source
Backlinks