Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ReportStatus = unset
  2. move-item -path f:\path\to\file.xls -destination \\path\to\filea.xls
  3.     if ($LASTEXITCODE -ge 1)
  4.         {
  5.         "Whoops, something bad happened while moving file" >> $logfilename
  6.         $ReportStatus = "Error"
  7.         }
  8.     else
  9.         {
  10.         "`nFile seems to have moved successfully" >> $logfilename
  11.         if ($ReportStatus = "Error")
  12.             {
  13.             return
  14.             }
  15.         else
  16.             {
  17.             $ReportStatus = "Success"
  18.             }
  19.         }
  20. #although the file moves successfully and I get the 'file seems to have moved successfully;
  21. #message, the $reportstatus does not get set with 'success'. hmmph
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement