Reputation: 688
I am currently at Users folder and want to get to Dockers folder.
I am not perform this due to the \OneDrive - xxxxx, zzz\
cd C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\
Error
PS C:\Users> cd C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\
Set-Location : A positional parameter cannot be found that accepts argument '-'.
At line:1 char:1
+ cd C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Upvotes: 0
Views: 1334
Reputation: 46
cd 'C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\'
Upvotes: 3
Reputation: 15518
Enclose it with single quotes:
cd 'C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\'
Double quotes should work, too:
cd "C:\Users\anmolparida\OneDrive - xxxxx, zzz\Work\Dockers\"
If you don't use double quotes, then powershell takes them as separate arguments, so Set-Location
fails, but when you quote regarded as value for single argument, -Path
.
Upvotes: 0