diff --git a/projects/msp-tools/guru-scan/GuruScan.psm1 b/projects/msp-tools/guru-scan/GuruScan.psm1 index 88accc5..cfffcd2 100644 --- a/projects/msp-tools/guru-scan/GuruScan.psm1 +++ b/projects/msp-tools/guru-scan/GuruScan.psm1 @@ -531,9 +531,16 @@ function Invoke-ScanPass { try { $startParams = @{ - FilePath = $launchExe - PassThru = $true - NoNewWindow = [bool]$Headless + FilePath = $launchExe + PassThru = $true + } + # Use WindowStyle=Hidden (not NoNewWindow) so scanner processes get + # their own window/console and do NOT inherit the PowerShell pipe + # handles. With NoNewWindow the child shares the parent console and + # inherits its stdout/stderr pipes; if a scanner hangs the pipe stays + # open after PowerShell exits, blocking the GuruRMM agent for hours. + if ($Headless) { + $startParams['WindowStyle'] = 'Hidden' } if ($expandedArgs -and $expandedArgs.Count -gt 0) { $startParams['ArgumentList'] = $expandedArgs