Since the PowerShell interface used by PSHELL is lingering, it could make sense for its CWD to NOT follow TCC's CWD around (but I can only imagine rather contrived such scenarios).
If you do want PSHELL's CWD to always match TCC's CWD you might
Code:
alias pshell `*pshell %@pshell[set-location %_cwd]`
The use of @PSHELL adds nothing to the command line. That usually works, but very rarely gives the error below.
Code:
l:\> pshell /s get-location
PSHELL: System.Management.Automation.PSInvalidOperationException : The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.
That error might be a timing error due to two very fast calls to the interface. Rex might want to look into it.
Here's a slightly different alias (with which I haven't seen a problem) and a cute example of its use.
Code:
v:\> which pshell
pshell is an alias : %@pshell[set-location "%_cwd"] delay 0 & *PSHELL
v:\> global /q ( pshell /s get-location | grep : )
V:\
V:\22extract
V:\22extract\8FFDD1C
V:\22extract\8FFDD1C\32-bit
V:\22extract\8FFDD1C\styles
V:\22extract\a&b
V:\22extract\DataBackup
V:\22extract\DataBackup\Program Files (x86)
V:\22extract\DataBackup\Program Files (x86)\Hewlett-Packard
V:\22extract\DataBackup\Program Files (x86)\Hewlett-Packard\HP Setup
V:\22extractxx
V:\22extractxx\8FFDD1C
V:\22extractxx\8FFDD1C\32-bit
V:\22extractxx\8FFDD1C\styles
V:\22extractxx\a&b
V:\22extractxx\DataBackup
V:\22extractxx\DataBackup\Program Files (x86)
V:\22extractxx\DataBackup\Program Files (x86)\Hewlett-Packard
V:\22extractxx\DataBackup\Program Files (x86)\Hewlett-Packard\HP Setup
V:\a b
V:\cksum
V:\cksum\32
V:\cksum\64
V:\database
V:\dir1
V:\dir2
V:\extracted
V:\IPReg
V:\IPReg\country
V:\IPReg\country\ok
V:\IPReg\IPReg
V:\math
V:\tcchelp
V:\v16.55
V:\v16.55\110ED81
V:\v16.55\110ED81\Styles
V:\v8