From 8afcf013bdeb242e0f4dc9b570b46d455c969d26 Mon Sep 17 00:00:00 2001 From: eeckert Date: Fri, 15 Sep 2023 09:08:24 -0600 Subject: [PATCH] Logic Fix... --- Get-ProjectFolders.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Get-ProjectFolders.ps1 b/Get-ProjectFolders.ps1 index 6339df1..e14c01b 100644 --- a/Get-ProjectFolders.ps1 +++ b/Get-ProjectFolders.ps1 @@ -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