I\'m having a problem moving forward through a path with PowerShell. I am able to move up the directory but not down. Here\'s the situation:
I open PowerShell and type
Before PowerShell can execute your cd
command, it needs to parse it, and PowerShell's parser interprets your command like this:
cd C:\Users\Robert Inspiron14
\/ \_____________/ \________/
Command Name | |
argument 1 |
argument 2
In other words, C:\Users\Robert
and Inspiron14
are interpreted as separate arguments.
Neither argument is a path to a valid directory, so cd
(or rather Set-Location
for which cd
is an alias) throws an error.
You can force PowerShell to recognize C:\Users\Robert Inspiron14
as a single string argument by qualifying its boundaries using quotation marks (both "
and '
will work):
cd 'C:\Users\Robert Inspiron14'
You can read more about how PowerShell parses command expressions in the about_Parsing help topic