clean up output folder if needed.
This commit is contained in:
parent
ab692c9632
commit
111f4dbb91
@ -178,6 +178,7 @@ foreach ($office in $OfficeList) {
|
|||||||
|
|
||||||
if ($sql_result) {
|
if ($sql_result) {
|
||||||
$OutFile = $OutputFolder + "\$OfficeServer Duplicates.xlsx"
|
$OutFile = $OutputFolder + "\$OfficeServer Duplicates.xlsx"
|
||||||
|
Remove-Item -Path $OutFile -Force
|
||||||
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -188,6 +189,7 @@ $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query
|
|||||||
|
|
||||||
if ($sql_result) {
|
if ($sql_result) {
|
||||||
$OutFile = $OutputFolder + "\MPE All Duplicates.xlsx"
|
$OutFile = $OutputFolder + "\MPE All Duplicates.xlsx"
|
||||||
|
Remove-Item -Path $OutFile -Force
|
||||||
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -199,6 +201,7 @@ $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query
|
|||||||
|
|
||||||
if ($sql_result) {
|
if ($sql_result) {
|
||||||
$OutFile = $OutputFolder + "\MPE Non-Duplicates - Parent Folders.xlsx"
|
$OutFile = $OutputFolder + "\MPE Non-Duplicates - Parent Folders.xlsx"
|
||||||
|
Remove-Item -Path $OutFile -Force
|
||||||
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -211,6 +214,7 @@ $sql_result = Invoke-SqliteQuery -DataSource $PathToDB -Query $Query
|
|||||||
|
|
||||||
if ($sql_result) {
|
if ($sql_result) {
|
||||||
$OutFile = $OutputFolder + "\MPE Non-Duplicates - Project Folders.xlsx"
|
$OutFile = $OutputFolder + "\MPE Non-Duplicates - Project Folders.xlsx"
|
||||||
|
Remove-Item -Path $OutFile -Force
|
||||||
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
$sql_result | Export-Excel -Path $OutFile -AutoFilter
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -218,10 +222,12 @@ if ($sql_result) {
|
|||||||
## Generate Egnyte Data Inventory Sheet
|
## Generate Egnyte Data Inventory Sheet
|
||||||
|
|
||||||
$OutFile = $OutputFolder + "\MPE Data Inventory " + (Get-Date -Format FileDateTime).DateTime + ".xlsx"
|
$OutFile = $OutputFolder + "\MPE Data Inventory " + (Get-Date -Format FileDateTime).DateTime + ".xlsx"
|
||||||
|
Remove-Item -Path $OutFile -Force
|
||||||
$SQLFile_to_Run = $PSScriptRoot + '\Generate Egnyte Export.sql'
|
$SQLFile_to_Run = $PSScriptRoot + '\Generate Egnyte Export.sql'
|
||||||
$EgnyteExport = Invoke-SqliteQuery -DataSource $PathToDB -InputFile $SQLFile_to_Run
|
$EgnyteExport = Invoke-SqliteQuery -DataSource $PathToDB -InputFile $SQLFile_to_Run
|
||||||
|
|
||||||
if ($EgnyteExport) {
|
if ($EgnyteExport) {
|
||||||
|
|
||||||
$OutFile = Export-Excel -Path $OutputFile -AutoFilter
|
$OutFile = Export-Excel -Path $OutputFile -AutoFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user