stupid code formatter
This commit is contained in:
parent
56afe487cc
commit
5e9b6e761f
@ -1,8 +1,10 @@
|
||||
-- Generate Non-Duplicated PARENT FOLDER List
|
||||
DROP TABLE DataInventory;
|
||||
CREATE TABLE DataInventory AS
|
||||
Select * from (
|
||||
SELECT SERVER,Parent,
|
||||
Select *
|
||||
from (
|
||||
SELECT SERVER,
|
||||
Parent,
|
||||
REPLACE(
|
||||
Parent,
|
||||
"X:\","\\mpe.ca\datadrive\") AS UNCPath,
|
||||
@ -32,4 +34,3 @@ where Parent in (
|
||||
HAVING count(*) > 1
|
||||
)
|
||||
and Source = 'Project';
|
||||
|
||||
|
@ -101,7 +101,7 @@ $OfficeList | ForEach-Object -parallel {
|
||||
}
|
||||
elseif ($result.Length -ge 5) {
|
||||
$Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
|
||||
$Path = $_.FullName
|
||||
$Path = $_.FullName.Replace("'", "''") #SQL Formatted Path
|
||||
$projectnumber = $result.tostring()
|
||||
$DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy
|
||||
$Query = "Select Project FROM FolderData where Project = '$ProjectNumber' AND Server = '$Server' AND Path = '$Path';"
|
||||
@ -119,7 +119,7 @@ $OfficeList | ForEach-Object -parallel {
|
||||
|
||||
$result3 = [Regex]::Matches($_.FullName, "^(.*[\\\/])") # This gets everything up the last slash, thus the "parent"
|
||||
$FolderPath_Data = Get-ChildItem -Path $_.FullName -File -Depth 50 -Recurse
|
||||
$folder_Parent = $result3.value
|
||||
$folder_Parent = $result3.value.replace("'", "''") #SQL Formatting
|
||||
$folder_FileSize = ($FolderPath_Data | Measure -sum Length).sum / 1024 / 1024 / 1024
|
||||
$folder_FileCount = ($FolderPath_Data | measure).Count
|
||||
$folder_LastWrite = ($FolderPath_Data | measure LastWriteTime -Maximum).Maximum
|
||||
@ -134,8 +134,8 @@ $OfficeList | ForEach-Object -parallel {
|
||||
$out = [PSCustomObject]@{
|
||||
Server = $Server
|
||||
Project = $ProjectNumber.ToString()
|
||||
Parent = "'$folder_Parent'"
|
||||
Path = "'$Path'"
|
||||
Parent = $folder_Parent
|
||||
Path = $Path
|
||||
FileCount = $folder_FileCount
|
||||
FileSize = $folder_FileSize
|
||||
FileLastWrite = $folder_LastWrite
|
||||
@ -232,7 +232,7 @@ catch {
|
||||
}
|
||||
$SQLFile_to_Run = $PSScriptRoot + '\Generate Egnyte Export.sql'
|
||||
Invoke-SqliteQuery -DataSource $PathToDB -InputFile $SQLFile_to_Run
|
||||
$EgnyteExport = Invoke-SqliteQuery -DataSource $PathToDB -Query "Select * from DataInventory"
|
||||
$EgnyteExport = Invoke-SqliteQuery -DataSource $PathToDB -Query "Select Server,UNCPath,EgnytePath,FileCount,FileSize,Source from DataInventory"
|
||||
|
||||
if ($EgnyteExport) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user