2

I have a Powershell script to remove items on a folder:

Get-ChildItem D:\FUNDACIÓN CB\Pedro Corchero Murga\Info de vídeos\Proyectos\* | Remove-Item -Recurse

The problem is that I'm having issues with the path because it have whitespaces and gives me this error:

Get-ChildItem : No se encuentra ningún parámetro de posición que acepte el argumento 'Corchero'.
En línea: 1 Carácter: 1
+ Get-ChildItem D:\FUNDACIÓN CB\Pedro Corchero Murga\Info de vídeos\Pro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

How I can fix it?

1 Answer 1

4

Simply add quotes " " to the path:

Get-ChildItem "D:\FUNDACION CB\........"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.