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\")
|
$Path = $Path.Replace("X:\", "\\mpe.ca\datadrive\")
|
||||||
$projectnumber = $result.tostring()
|
$projectnumber = $result.tostring()
|
||||||
$DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy
|
$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
|
$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 = @{
|
$CurentLoopProgress = @{
|
||||||
ID = $JobID
|
ID = $JobID
|
||||||
Activity = "Loading Telemetry for " + $_.FullName
|
Activity = "Loading Telemetry for " + $_.FullName
|
||||||
@ -120,15 +120,7 @@ $OfficeList | ForEach-Object -parallel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Progress @CurentLoopProgress
|
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"
|
$result3 = [Regex]::Matches($_.FullName, "^(.*[\\\/])") # This gets everything up the last slash, thus the "parent"
|
||||||
$FolderPath_Data = Get-ChildItem -Path $_.FullName -File -Depth 50 -Recurse
|
$FolderPath_Data = Get-ChildItem -Path $_.FullName -File -Depth 50 -Recurse
|
||||||
$folder_Parent = $result3.value.replace("'", "`'") #SQL Formatting
|
$folder_Parent = $result3.value.replace("'", "`'") #SQL Formatting
|
||||||
|
Loading…
Reference in New Issue
Block a user