diff --git a/Get-ProjectFolders.ps1 b/Get-ProjectFolders.ps1 index 788ac72..567e06c 100644 --- a/Get-ProjectFolders.ps1 +++ b/Get-ProjectFolders.ps1 @@ -166,7 +166,7 @@ $DBConnect = New-SqliteConnection -DataSource $PathToDB foreach ($office in $OfficeList) { $OfficeServer = $office.Substring(1, 4) -replace (':|\\', '') - $Query = "select * from OfficeDuplicates where Server = '$OfficeServer'" + $Query = "select * from OfficeDuplicates where Server = '$OfficeServer';" $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query if ($sql_result) { @@ -176,7 +176,7 @@ foreach ($office in $OfficeList) { } } # Generate MPE All Xlsx -$Query = "select * from OfficeDuplicates" +$Query = "select * from OfficeDuplicates;" $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query if ($sql_result) { @@ -185,6 +185,30 @@ if ($sql_result) { } +# Generate Parent Non-Duplicates + +$Query = "select * from NonDupParent;" +$sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query + +if ($sql_result) { + $OutFile = $OutputFolder + "\MPE Non-Duplicates - Parent Folders.xlsx" + $sql_result | Export-Excel -Path $OutFile -AutoFilter + +} + + +# Generate Project Non-Duplicates + +$Query = "select * from NonDupProject where Path NOT IN (select Path from NonDupParent);" +$sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query + +if ($sql_result) { + $OutFile = $OutputFolder + "\MPE Non-Duplicates - Project Folders.xlsx" + $sql_result | Export-Excel -Path $OutFile -AutoFilter + +} + + $DBConnect.Close()