This PowerShell script allows you to manage a list of favorite directories. You can add, update, delete, and list directories, as well as navigate to them. It also includes a prune
function to remove entries for directories that no longer exist.
- List: Display all favorite directories.
- Add: Add a new favorite directory.
- Update: Update the path of an existing favorite directory.
- Delete: Delete a favorite directory.
- Change Directory (cd): Change to the directory of a favorite directory.
- Rename: Rename a favorite directory.
- Prune: Remove entries with non-existent directories.
- Help: Show usage instructions.
- PowerShell 5.1 or later.
- The script assumes unique directory names.
-
Download the Script:
- Save the script as
fav_dirs.ps1
to your preferred directory.
- Save the script as
-
Set Execution Policy:
- Ensure your PowerShell execution policy allows running scripts. You can set it using:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
- Ensure your PowerShell execution policy allows running scripts. You can set it using:
To use the script, navigate to the directory where the script is saved and run it with the desired command and arguments.
.\fav_dirs.ps1 list