Using Get-ChildItem to Move Files

This topic is resolved

Share

This topic contains 4 replies, has 3 voices, and was last updated by  Chris 3 months, 1 week ago.

  • Author
    Posts
  • #1233953
     Chris 
    Participant
    Post count: 20
    Member Points: 1,300
    Rank: Level 1

    Need help using Get-Childitem and I need it to create a new folder and then copy the contents of the D drive to that folder. For some reason it will only create the folder without copying over the contents of D:\

     

    This is what is looks like now.

    • This topic was modified 3 months, 1 week ago by  Chris.
    • This topic was modified 3 months, 1 week ago by  Chris.
    0
  • #1234125
     Swapnil Kambli 
    Moderator
    Post count: 48
    Member Points: 4,750
    Rank: Level 1

    Hi Chris,

    Please use below code

    1+

    Users who have liked this topic:

    • avatar
  • #1234134
     Michael Pietroforte 
    Keymaster
    Post count: 1766
    Member Points: 21,663
    Author of the year 2018
    Rank: Level 1

    If you really want to move files, you might consider working with Move-Item instead of Copy-Item.

    0
  • #1234152
     Chris 
    Participant
    Post count: 20
    Member Points: 1,300
    Rank: Level 1

    Swapnil — I’ll try that.

     

    Michael — I don’t want the files to be deleted from the CD

    0
  • #1234164
     Chris 
    Participant
    Post count: 20
    Member Points: 1,300
    Rank: Level 1

    Swapnil, that worked. Thanks.

    1+

    Users who have liked this topic:

    • avatar

You must be logged in to reply to this topic.

© 4sysops 2006 - 2019

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account