daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ArchivesMPath = "E:ArchivesBDDMensuelles"
  2. $SauvegardeMPath = "E:SauvegardeBDDMensuelle"
  3. $ArchivesQPath = "E:ArchivesBDDQuotidiennes"
  4. $SauvegardeQPath = "E:SauvegardeBDDQuotidienne"
  5. $DAYSOFWEEK = "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"
  6. $MONTHS = "Decembre", "Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre"
  7.  
  8. $DAILYDIR = "$ArchivesQPath$($DAYSOFWEEK[(get-date).AddDays(-1).DayOfWeek.value__])"
  9. if ([System.IO.Directory]::Exists($DAILYDIR)){
  10.     Remove-Item $DAILYDIR -Force -Recurse
  11. }
  12. New-Item -Path $DAILYDIR -ItemType directory
  13. Move-Item -Path "$SauvegardeQPath*" -Destination $DAILYDIR
  14.  
  15. if ((get-date).AddDays(-1).day -eq 1){
  16.     $MONTHLYDIR = "$ArchivesMPath$($MONTHS[(get-date).month])"
  17.     if ([System.IO.Directory]::Exists($MONTHLYDIR)){
  18.         Remove-Item $MONTHLYDIR -Force -Recurse
  19.     }
  20.     New-Item -Path $MONTHLYDIR -ItemType directory
  21.     Move-Item -Path "$SauvegardeMPath*" -Destination $MONTHLYDIR
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top