Script Center > Scripting Forums > The Official Scripting Guys Forum! > Newbie : Syntax Problem in Powershell
Ask a questionAsk a question
 

AnswerNewbie : Syntax Problem in Powershell

  • Friday, November 20, 2009 8:58 PMsaurabh180407 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    # setting the folder location 
    $loc = 'e:\dsain\dc prd' 

    # i want to use dos command from power shell to list the  contents of above dir 
    # i am using following command 

    invoke-expression "cd $loc : dir" 

    i get an error 
    Set-Location : A parameter cannot be found that matches parameter name 'prd'. 
    At line:1 char:3 
    + cd <<<< e:\saurabh\eain preid dir 

    --it works fine if there is no space in folder name i.e 
    if 
    $loc = 'e:\dsain\dcprd'

    student

Answers

All Replies