-1
0
cd C:\Users\Rupesh Kumar\Documents
There is a space between "Rupesh Kumar"
which doesn't allow me to change the directory but it is working in CMD.
Set-Location : A positional parameter cannot be found that accepts argument 'Kumar\Desktop'.
At line:1 char:1
+ cd C:\Users\Rupesh Kumar\Desktop
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
This just says you are just starting with PowerShell, so, please be sure to spend the needed time leading it first, to limit / eliminate confusion, misconception, bad code, errors, etc... YouTube is your friend https://www.youtube.com/results?search_query=powershell+file+and+folder+management as well as the tons of free no cost guidance, training available all over the web. Always use full PowerShell cmdlet / function names and parameters. Shorthand / aliases like you are using are fine for interactive stuff, but not scripts, and you are still bound by what PowerShell expects.
– postanote – 2019-10-14T00:32:57.013