Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ReportStatus = unset
- move-item -path f:\path\to\file.xls -destination \\path\to\filea.xls
- if ($LASTEXITCODE -ge 1)
- {
- "Whoops, something bad happened while moving file" >> $logfilename
- $ReportStatus = "Error"
- }
- else
- {
- "`nFile seems to have moved successfully" >> $logfilename
- if ($ReportStatus = "Error")
- {
- return
- }
- else
- {
- $ReportStatus = "Success"
- }
- }
- #although the file moves successfully and I get the 'file seems to have moved successfully;
- #message, the $reportstatus does not get set with 'success'. hmmph
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement