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
}
elseif ($result.Length -ge 5) {
$projectnumber = $result
$Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
$projectnumber = $result.tostring()
$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
if (($sql_result.project -eq $null)) {
@ -131,7 +131,7 @@ $OfficeList | ForEach-Object -parallel {
else {
$out = [PSCustomObject]@{
Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
Server = $Server
Project = $ProjectNumber.ToString()
Parent = $folder_Parent
Path = $_.FullName
@ -230,5 +230,5 @@ if ($EgnyteExport) {
$DBConnect.Close()
Write-Progress @ServerProgress -completed