Tracks your most used directories, based on number of previously run commands.
After a short learning phase,
z will take you to the most popular directory that matches all of the regular expressions given on the command line.
You can use Tab-Completion / Intellisense to pick directories that are not the first choice.
ZLocation keeps track of your
$pwd (current folder).
Once visited, folder become known to ZLocation.
cd with just a hint of the path!
The full command name is
Invoke-ZLocation, but in examples I use alias
It's all about navigation speed, isn't it?
PS C:\Users\sevoroby> z c: PS C:\> z zlo PS C:\dev\ZLocation> z dsc PS C:\dev\azure-sdk-tools\src\ServiceManagement\Compute\Commands.ServiceManagement\IaaS\Extensions\DSC> z test PS C:\dev\ZLocation\ZLocation.Tests>
List known locations
z without arguments will list all the known locations and their weights (short-cut for
To see all locations matched to a query
z -l foo.
Navigating to less common directories with tab completion
z mydir doesn't take you to the correct directory, you can also tab through
For example, pressing tab with
z src will take you through all of ZLocation's
ZLocation keeps a stack of directories as you jump between them.
z - will
"pop" the stack: it will move you to the previous directory you jumped to,
basically letting you undo your
If the stack is empty (you have only jumped once),
z - will take you to your
C:\>z foo C:\foo>z bar C:\baz\bar> z - C:\foo>z - C:\>z - C:\>#no-op
Goals / Key features
- Support for multiple PS sessions.
- Good built-in ranking algorithm.
Customizable matching algorithm and weight function.
- Works on Windows, Linux and MacOS.
Install from PowerShellGet Gallery
Install-Module ZLocation -Scope CurrentUser
Make sure to include ZLocation import in your
It intentionally doesn't alternate
$profile automatically on installation.
This one-liner installs ZLocation, imports it and adds it to a profile.
Install-Module ZLocation -Scope CurrentUser; Import-Module ZLocation; Add-Content -Value "`r`n`r`nImport-Module ZLocation`r`n" -Encoding utf8 -Path $profile.CurrentUserAllHosts
If you want to display some additional information about ZLocation on start-up, you can put this snippet in
$profile after import.
Write-Host -Foreground Green "`n[ZLocation] knows about $((Get-ZLocation).Keys.Count) locations.`n"
ZLocation alternates your
prompt function to track the location.
If you have a custom prompt function in
$profile, you should place
Import-Module ZLocation after the prompt customization.
ZLocation is released under the MIT license.
ZLocation bundles a copy of LiteDB.
Copyright (c) 2017 - Maurício David.
Invoke-Pester from the root folder.