top | item 33422304

(no title)

juki | 3 years ago

`dirs -v` would be `Get-Location -Stack`. Also in newish versions PowerShell `Set-Location` (aliased to `cd`) supports -/+ to move backwards/forwards in it's own history, so usually you don't even need to bother with `pushd`/`popd` unless you need a named stack.

discuss

order

0x445442|3 years ago

what about pushd 7 to go to the 7th path in the stack?

juki|3 years ago

Just get the 7th path from `Get-Location` and `Set-Location` there, e.g.

  function Set-StackLocation ($Position) {
    (gl -Stack).Path | select -Index $Position | cd
  }