PoshCode Logo PowerShell Code Repository

Kill Outlook + CopyPST (modification of post by papafred view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1691"></script>download | new post

  1. $rep_du_user = $env:userprofile
  2. $repertoire_pst = ($rep_du_user+"\AppData\Local\Microsoft\Outlook")
  3. $repertoire_sauvegarde = "directory"
  4.  
  5. #Kill de outlook
  6. Get-Process | Where { $_.Name -Eq "outlook" } | stop-process
  7.  
  8. #wait and see :)
  9. sleep 10
  10.  
  11. #copy des pst
  12. xcopy $repertoire_pst $repertoire_sauvegarde /D /E /C /R /H /I /K /Y /G

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me