diff --git a/Copy-Revit2Egnyte.ps1 b/Copy-Revit2Egnyte.ps1
index 1490999..f8f2415 100644
--- a/Copy-Revit2Egnyte.ps1
+++ b/Copy-Revit2Egnyte.ps1
@@ -8,7 +8,7 @@ This script will copy these files to Egnyte nightly. It will email helpdesk@mpe.
#>
-$Local_Revit_Root = "R:\"
+$Local_Revit_Root = "\\mpe.ca\onprem\Revit\"
$OnPrem_DataCollector = "\\192.168.2.75\scache\Shared\"
$ErrorMessage = @()
@@ -66,7 +66,7 @@ function Send-Email {
}
}
-$Local_Folder_List = get-childitem -path $Local_Revit_Root -Depth 0 -Directory
+$Local_Folder_List = get-childitem -path $Local_Revit_Root -Depth 0
foreach ($folder in $Local_Folder_List) {
if ($folder.Name -eq "!TEMPLATE") {
@@ -86,16 +86,16 @@ foreach ($folder in $Local_Folder_List) {
if ($OnPrem_DataCollector_up) {
# Validate Egnyte Path
- if (!(Test-Path $Egnyte_Path)) {
+ if (!(Test-Path $OnPrem_DC_Path)) {
$Egnyte_Path_Valid = $false
- $ErrorMessage += $FolderName + ": Path.txt error: Egnyte Path Doesn't Exist.
"
+ $ErrorMessage += '`"' + $FolderName + "`": Path.txt error: Egnyte Path Doesn't Exist.
"
}
else {
$Egnyte_Path_Valid = $true
}
if (!($NumberofLines.Lines -eq 1)) {
$Egnyte_Path_Valid = $false
- $ErrorMessage += $FolderName + ": Path.txt must specify only one path.
"
+ $ErrorMessage += '`"' + $FolderName + "`": Path.txt must specify only one path.
"
}
else {
@@ -110,11 +110,12 @@ foreach ($folder in $Local_Folder_List) {
Write-Output "Copying $foldername to Egnyte"
# $Source_Path = $folder.FullName + "\*"
$Source_Path = $folder.FullName
- robocopy.exe $Source_Path $OnPrem_DC_Path /MT:5 /w:5 /r:5 /XO /COPY:DAT
+ $LogPath = $OnPrem_DC_Path + '\CopyLog.log'
+ robocopy.exe $Source_Path $OnPrem_DC_Path /MT:5 /w:5 /r:5 /XO /COPY:DAT /log:$LogPath
# Copy-Item $Source_Path $OnPrem_DC_Path -Force -Recurse
}
} else {
- $ErrorMessage += $FolderName + ": On Premise Path not Valid: $OnPrem_DC_Path. Is the server up?
"
+ $ErrorMessage += '`"' + $FolderName + "`": On Premise Path not Valid: `"$OnPrem_DC_Path`". Is the server up?
"
}