Moving a file where the folder name changes by date…

Welcome Forums General PowerShell Q&A Moving a file where the folder name changes by date…

Viewing 3 reply threads
  • Author
    Posts
    • #210111
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      I am trying to do a move-item with a source path that will equal \\path to server\”folder name usually dated yyyymmdd format (20200313)”\filename.xlsx

       

      The folder name (dated) will obviously change everyday… so is there a way to make that part of the path a variable, or do I need to maybe do a get-childitem, pipe it to move-item with condition of “where-object”???

       

       

    • #210120
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP
      \\path to server\*\filename.xlsx
    • #210126
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      I guess I just assumed the simple way wouldn’t work…lol I always prepare for things to be complicated.

       

       

      I’ll give it a try

    • #210132
      Participant
      Topics: 1
      Replies: 2
      Points: 16
      Rank: Member

      it works… sorry for the dumb question. Obviously my brain was eliminating the easiest solution. And I’ve done it that way before and still chose to not remember.

       

       

      Thank you Olaf

Viewing 3 reply threads
  • You must be logged in to reply to this topic.