Skip to content

Commit 1e8838a

Browse files
committedNov 20, 2022
Add clean block.
1 parent 9d22418 commit 1e8838a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎Data/Import-DataTable.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ function Import-DataTable {
113113
}
114114
$numLines = if ($Skip -gt $i) { 0 } else { $i - $Skip }
115115
Write-Verbose "Read $numLines lines of $file"
116+
if ($reader) { $reader.Dispose() }
116117
# Add comma before so PowerShell doesn't convert to Object[]!
117118
, $result
118119
}
120+
clean {
121+
if ($reader) { $reader.Dispose() }
122+
}
119123
}

0 commit comments

Comments
 (0)
Failed to load comments.