[PS] Bug? Misleading error message for Rename-Item when specifying a path

Discussion in 'Scripting' started by Alex K. Angelopoulos [MVP], May 18, 2006.

  1. Note the following actions and error message:

    PS> Rename-Item -Path C:\temp\New.Directory\file1 fileOne
    PS> Rename-Item -Path C:\temp\New.Directory\fileOne c:\temp\fileOne
    Rename-Item : Cannot rename because the target specified is not a path.
    At line:1 char:12
    + Rename-Item <<<< -Path C:\temp\New.Directory\fileOne c:\temp\fileOne
    PS>

    The REAL problem here is that the target specified IS a path and not a name.
    Bug this?

    Also, the help for Rename-Item should make it explicit that it CANNOT be
    used as a Move-Item command.
     
    Alex K. Angelopoulos [MVP], May 18, 2006
    #1
    1. Advertisements

  2. Please do.
     
    Lee Holmes [MSFT], May 19, 2006
    #2
    1. Advertisements

  3. https://connect.microsoft.com/feedback/ViewFeedback.aspx?SiteID=99&FeedbackID=77304

     
    Alex K. Angelopoulos [MVP], May 19, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.