Add more Auto-reporting

This commit is contained in:
Erik Eckert 2023-09-14 13:26:42 -06:00
parent 797cef6493
commit 0781b1e7a8

View File

@ -166,7 +166,7 @@ $DBConnect = New-SqliteConnection -DataSource $PathToDB
foreach ($office in $OfficeList) { foreach ($office in $OfficeList) {
$OfficeServer = $office.Substring(1, 4) -replace (':|\\', '') $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 $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query
if ($sql_result) { if ($sql_result) {
@ -176,7 +176,7 @@ foreach ($office in $OfficeList) {
} }
} }
# Generate MPE All Xlsx # Generate MPE All Xlsx
$Query = "select * from OfficeDuplicates" $Query = "select * from OfficeDuplicates;"
$sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query
if ($sql_result) { 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() $DBConnect.Close()