Parsing arguments for cd command
What is missing

A compatibility with existing shells. There are certain expectations on how the expansion works; your code expands in an incompatible way; expect end-user complains:


Tilde is expanded only in the beginning of the word. You expand it anywhere.
Tilde may be followed by a login name, then the whole prefix is expanded to a home directory of that user. You do not expand the tilde-prefix.
There is no provision to escape tilde or $ from expanding.
There is no way to limit variable name before it hits the path separator.


How to deal with the duplicate code around ApplyEnvVariable() calls

I guess, the simplest way is to move the duplicated code directly into ApplyEnvVariable(). That would actually justify the name of the method: as of now it doesn't apply the variable but merely expands it.  Of course you'd need to pass Out.end() instead of Temp there.

Naming

It is very unusual to have variable names capitalized.