diff --git a/Get-ProjectFolders.ps1 b/Get-ProjectFolders.ps1 index 801871f..47f8f12 100644 --- a/Get-ProjectFolders.ps1 +++ b/Get-ProjectFolders.ps1 @@ -101,9 +101,10 @@ $OfficeList | ForEach-Object -parallel { } elseif ($result.Length -ge 5) { $Server = $_.FullName.Substring(1, 4) -replace (':|\\', '') + $Path = $_.FullName $projectnumber = $result.tostring() $DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy - $Query = "Select Project FROM FolderData where Project = '$ProjectNumber' AND Server = '$Server';" + $Query = "Select Project FROM FolderData where Project = '$ProjectNumber' AND Server = '$Server' AND Path = '$Path';" $sql_result = Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query if (($sql_result.project -eq $null)) { @@ -124,7 +125,7 @@ $OfficeList | ForEach-Object -parallel { $folder_LastWrite = ($FolderPath_Data | measure LastWriteTime -Maximum).Maximum $folder_LastAccess = ($FolderPath_Data | measure LastAccessTime -Maximum).Maximum - if ($folder_FileSize -le 0 -or $folder_FileCount -eq $null) { + if ($folder_FileSize -le 0 -or $folder_FileCount -eq 0) { #Let's ignore Null Values }