Logic Fix...
This commit is contained in:
parent
f42a5cd079
commit
8afcf013bd
@ -100,10 +100,10 @@ $OfficeList | ForEach-Object -parallel {
|
||||
# Write-Progress @CurentLoopProgress
|
||||
}
|
||||
elseif ($result.Length -ge 5) {
|
||||
|
||||
$projectnumber = $result
|
||||
$Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
|
||||
$projectnumber = $result.tostring()
|
||||
$DBConnect = New-SqliteConnection -DataSource $PathToDB_Copy
|
||||
$Query = "Select Project FROM FolderData where Project = '$ProjectNumber'"
|
||||
$Query = "Select Project FROM FolderData where Project = '$ProjectNumber' AND Server = '$Server';"
|
||||
$sql_result = Invoke-SqliteQuery -DataSource $PathToDB_Copy -Query $Query
|
||||
|
||||
if (($sql_result.project -eq $null)) {
|
||||
@ -131,7 +131,7 @@ $OfficeList | ForEach-Object -parallel {
|
||||
else {
|
||||
|
||||
$out = [PSCustomObject]@{
|
||||
Server = $_.FullName.Substring(1, 4) -replace (':|\\', '')
|
||||
Server = $Server
|
||||
Project = $ProjectNumber.ToString()
|
||||
Parent = $folder_Parent
|
||||
Path = $_.FullName
|
||||
@ -230,5 +230,5 @@ if ($EgnyteExport) {
|
||||
|
||||
|
||||
$DBConnect.Close()
|
||||
|
||||
Write-Progress @ServerProgress -completed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user