Skip to content

Meqr1/mqcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

What is mqcd?

  • mqcd is a tool for windows powershell and microsoft terminal users which helps sync the starting directory for any new opened powershell window.

How to use it?

if you already have created a powershell config insert these lines in it...

Remove-Alias cd

if (Test-Path $historyPath) {
    ~/mqcd.exe get | sl
}

function cd ($path) {
    if ($path) {

        sl $path

        # Check if 'sl' succeeded
        if (-not $?) {
            Write-Host "Error: Failed to change directory to $path."
            return  # Exit the function if 'sl' fails
        }

        $path = Get-Location

        ~/mqcd.exe set $path
    } else {
        sl

        # Check if 'sl' succeeded
        if (-not $?) {
            Write-Host "Error: Failed to change to the home directory."
            return  # Exit the function if 'sl' fails
        }

        ~/mqcd.exe set ~
    }
}

this code snippet will remove the alias cd and add a custom cd function

!IMPORTANT

put the mqcd.exe on the ~/mqcd.exe path

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages