i said Shush...

This commit is contained in:
Erik Eckert 2023-09-15 11:27:45 -06:00
parent 111f4dbb91
commit aec05f5f69

View File

@ -221,14 +221,21 @@ 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) + ".xlsx"
Remove-Item -Path $OutFile -Force try {
Remove-Item -Path $OutFile -Force -ErrorAction SilentlyContinue
}
catch {
<#Do this if a terminating exception happens#>
}
$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 Invoke-SqliteQuery -DataSource $PathToDB -InputFile $SQLFile_to_Run
$EgnyteExport = Invoke-SqliteQuery -DataSource $PathToDB -Query "Select * from DataInventory"
if ($EgnyteExport) { if ($EgnyteExport) {
$OutFile = Export-Excel -Path $OutputFile -AutoFilter $EgnyteExport | Export-Excel -Path $OutFile -AutoFilter
} }