Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $USS_Folder = "D:\POBRANE"
  2.  
  3. get-childitem | % {
  4.  
  5.     $file = $_.FullName
  6.     $date = Get-Date ($_.CreationTime)
  7.     $month = $date.month
  8.     $year = $date.year
  9.     $TARGETDIR = "$USS_Folder\$year\$month"
  10.     if(!(Test-Path -Path $TARGETDIR )){
  11.         New-Item -ItemType directory -Path $TARGETDIR
  12.     }
  13.     move-item $file $TARGETDIR
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement