A powershell module to switch directory quickly
-
Install from PowerShell Gallery(Suggestion)
Install-Module -Name directory-stack
-
Update from PowerShell Gallery(Suggestion)
Update-Module -Name directory-stack
- [TODO] It seems that you need to manually go to the directory and remove the old version files for the updated module to take effect.
-
Install mannual
- download this repository:
git clone [email protected]:ACupofAir/Directory-Stack.git
and rename it todirectory-stack
- reference the folder in you powershell profile(
$PROFILE
is the default powershell config filek) , add this line to the profileImport-Module -Name $repository_path -DisableNameChecking
- download this repository:
-
Optional Config: set alias of the function names in your
$PROFILE
to use them easily# in $PROFILE(usually is "~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1") Set-Alias -Name dv Get-Dir-Stack Set-Alias -Name pd Add-Dir-Item Set-Alias -Name pp Remove-Dir-Stack-Item Set-Alias -Name jp Set-Stacked-Dir
curl -sSL https://raw.githubusercontent.com/ACupofAir/Directory-Stack/main/bash/install.sh | bash
Following usage will run rightly after config alias in $PROFILE
cmd | info |
---|---|
pd |
pushd current directory in the stack |
pd $DIR_NAME |
pushd $DIR_NAME in the stack |
pp $DIR_INDEX |
popd directory index $DIR_INDEX in stack out |
dv |
show the table of stack(named from the linux command dirs -v), and waiting for user to input the index of directory want to go |
jp $DIR_INDEX |
jump to the directory whose index is $DIR_INDEX in the stack |
cmd | info |
---|---|
pd |
pushd current directory in the stack |
pd $DIR_NAME |
pushd $DIR_NAME in the stack |
pp $DIR_INDEX |
popd directory index $DIR_INDEX in stack out and jump to the directory |
rmd $DIR_INDEX |
remove directory index $DIR_INDEX in stack |
dv |
show the table of stack(named from the linux command dirs -v) |
jp $DIR_INDEX |
jump to the directory whose index is $DIR_INDEX in the stack |
cldirs |
temporarily clear stack, when you start a new stack, the directory stack will be restored |
version | release date | description |
---|---|---|
v1.1.0 | 02/03/2023 | add autoload directory support |
v1.2.2 | 06/27/2023 | make all directory store in file |