Advertisement
m0onmo0n

not working script

Mar 21st, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. Get-ChildItem g:\old*.mp4 -Recurse | foreach {
  2. $x = $_.LastWriteTime.ToShortDateString()
  3. $new_folder_name = Get-Date $x -Format yyyy.MM.dd
  4. $des_path = "g:\old\$new_folder_name"
  5.  
  6. if (test-path $des_path){
  7. move-item $_.fullname $des_path
  8. } else {
  9. new-item -ItemType directory -Path $des_path
  10. move-item $_.fullname $des_path
  11. }
  12. }
  13. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement