move data from one folder to another

Welcome Forums General PowerShell Q&A move data from one folder to another

  • This topic has 1 reply, 1 voice, and was last updated 3 months ago by
    Moderator
    .
Viewing 1 reply thread
  • Author
    Posts
    • #203886
      Participant
      Topics: 1
      Replies: 0
      Points: 9
      Rank: Member

      Hello All, I would like to move particular data from one folder to another folder for that im using this power shell command

      Importing Active Directory CSV

      $profile = Import-Csv -Path ‘C:\Users\amahankali\desktop\ACTIVE_DIRECTORY.csv’
      $Folder = Get-ChildItem -Path ‘C:\Users\amahankali\Test Folders’ | select -Property Name
      $Former_Employee = $profile | where-object {$_.title -eq “Former_Employee”} | export-csv “C:\Users\amahankali\Desktop\former.csv” -NoTypeInformation
      $Former_Employee.cont
      Compare-Object $compformer.netid $Folder.name -IncludeEqual | export-csv “C:\Users\amahankali\Desktop\Commformer.csv” -NoTypeInformation
      $list = “c:\users\amahankali\desktop\commformer.csv”
      $remove = Import-csv $list | Where-Object {$_.”sideindicator” -eq “==”} | Export-Csv “c:\users\amahankali\desktop\FinalFormer.csv” -NoTypeInformation
      
      $var1 = ‘C:\users\amahankali\Test folders’ $var2 = ‘C:\users\amahankali\desktop\archive folder’ $file = get-childitem -path ‘c: amahankali\desktop\finalformer’ foreach($file in var1) { call $file if ($file inputobject -eq $var1{ move-item -path $var2 } }

      can anyone help me how to move data of formaer employee which is in test folder to archive folder by using powershell

      • This topic was modified 3 months, 1 week ago by grokkit.
      • This topic was modified 3 months, 1 week ago by grokkit. Reason: please format your code as per the forum posting instructions
    • #205278
      Moderator
      Topics: 3
      Replies: 212
      Points: 1,160
      Helping Hand
      Rank: Community Hero

      Hi Amala,

      Did you google/Bing anything before you putting down some code?

      There are plenty of articles on this over the internet.

      For this scenario you should use robocopy. Please refer to the link below…

      https://somoit.net/powershell/powershell-script-to-move-profile-folders

      Please do let us know, if you see anything odd.

      Thank you.

Viewing 1 reply thread
  • The topic ‘move data from one folder to another’ is closed to new replies.