Skip to content

Commit 220edc4

Browse files
Final polish: proper null comparison and timeout documentation
Co-authored-by: chris1642 <24726206+chris1642@users.noreply.github.com>
1 parent 0b2cef4 commit 220edc4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Final PS Script.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function Show-EnvironmentPicker {
180180

181181
# Timer (auto-close after 120 seconds)
182182
$timer = New-Object System.Windows.Forms.Timer
183-
$timer.Interval = 120000
183+
$timer.Interval = 120000 # 120 seconds in milliseconds
184184
$timer.Add_Tick({
185185
$timer.Stop()
186186
$form.Tag = 'Timeout'
@@ -214,8 +214,8 @@ function Show-EnvironmentPicker {
214214
}
215215
finally {
216216
# Ensure resources are always disposed
217-
if ($timer) { $timer.Dispose() }
218-
if ($form) { $form.Dispose() }
217+
if ($null -ne $timer) { $timer.Dispose() }
218+
if ($null -ne $form) { $form.Dispose() }
219219
}
220220
}
221221

0 commit comments

Comments
 (0)