remove last reference to Project
This commit is contained in:
parent
59bab0c703
commit
d5219e90f4
@ -108,11 +108,11 @@ $OfficeList | ForEach-Object -parallel {
|
||||
$Path = $Path.Replace("X:\", "\\mpe.ca\datadrive\")
|
||||
$projectnumber = $result.tostring()
|
||||
$DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy
|
||||
$Query = "Select Project,fld_LastRefresh FROM FolderData where Server = '$Server' AND Path = `"$Path`";"
|
||||
$Query = "Select fld_LastRefresh FROM FolderData where Server = '$Server' AND Path = `"$Path`";"
|
||||
$sql_result = Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query
|
||||
|
||||
|
||||
if (($sql_result.project -eq $null) -or ($sql_result.fld_LastRefresh -le (Get-Date).AddDays($RefreshDays).ToShortDateString())) {
|
||||
if (($sql_result.fld_LastRefresh -le (Get-Date).AddDays($RefreshDays).ToShortDateString())) {
|
||||
$CurentLoopProgress = @{
|
||||
ID = $JobID
|
||||
Activity = "Loading Telemetry for " + $_.FullName
|
||||
@ -121,14 +121,6 @@ $OfficeList | ForEach-Object -parallel {
|
||||
|
||||
Write-Progress @CurentLoopProgress
|
||||
|
||||
if ($sql_result.project -ne $null) {
|
||||
# found a record, but needs updating - delete old record from DB
|
||||
$Query = "Delete from FolderData WHERE Server = '$Server' AND Path = `"$Path`""
|
||||
Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query
|
||||
|
||||
|
||||
}
|
||||
|
||||
$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.replace("'", "`'") #SQL Formatting
|
||||
|
Loading…
Reference in New Issue
Block a user