Logic Fix...

This commit is contained in:
Erik Eckert 2023-09-15 09:08:24 -06:00
parent f42a5cd079
commit 8afcf013bd

View File

@ -100,10 +100,10 @@ $OfficeList | ForEach-Object -parallel {
# Write-Progress @CurentLoopProgress # Write-Progress @CurentLoopProgress
} }
elseif ($result.Length -ge 5) { elseif ($result.Length -ge 5) {
$Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
$projectnumber = $result $projectnumber = $result.tostring()
$DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy $DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy
$Query = "Select Project FROM FolderData where Project = '$ProjectNumber'" $Query = "Select Project FROM FolderData where Project = '$ProjectNumber' AND Server = '$Server';"
$sql_result = Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query $sql_result = Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query
if (($sql_result.project -eq $null)) { if (($sql_result.project -eq $null)) {
@ -131,7 +131,7 @@ $OfficeList | ForEach-Object -parallel {
else { else {
$out = [PSCustomObject]@{ $out = [PSCustomObject]@{
Server = $_.FullName.Substring(1, 4) -replace (':|\\', '') Server = $Server
Project = $ProjectNumber.ToString() Project = $ProjectNumber.ToString()
Parent = $folder_Parent Parent = $folder_Parent
Path = $_.FullName Path = $_.FullName
@ -230,5 +230,5 @@ if ($EgnyteExport) {
$DBConnect.Close() $DBConnect.Close()
Write-Progress @ServerProgress -completed