Skip to content

'cd -' capability added in PowerShell 6.1 #2476

Description

PR PowerShell/PowerShell#5051 adds the capability of going back to the previous location(s) when using Set-Location to enable cd - scenarios (a feature that shells like e.g. bash have and is commonly used by people by Unix backgrounds; git has a similar functionality as well btw)
Bash allows only to go back one location but PowerShell allows up to 20 locations.
Example:

C:\> cd C:\foo
C:\foo> cd C:\bar
C:\bar> cd -
C:\foo> cd -
C:\>

In Contrast to the bash implementation, PowerShell handles the history internally (bash does by setting an environment variable named OLDPWD)

Issue Details

Version(s) of document impacted

  • Impacts 6.1 document
  • Impacts 6.0 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not selecting all version of documents

  • The documented feature was introduced in selected version of PowerShell
  • This issue only shows up in selected version of the document

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri0Priority - Highestarea-managementArea - Microsoft.PowerShell.Management module

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions