Issue
Multiple PowerShell files use Write-Host which is discouraged in PowerShell best practices. Write-Host has several limitations:
- Might not work in all hosts
- Does not work when there is no host
- Prior to PowerShell 5.0, cannot be suppressed, captured, or redirected
Affected Files
Eigenverft.Manifested.Agent.InvokeCodexTask.ps1
- Line 612:
Write-Host $text
Eigenverft.Manifested.Agent.InvokeGeminiTask.ps1
- Line 546:
Write-Host ([string]$record.Line)
- Line 624:
Write-Host ([string]$line)
- Line 636:
Write-Host ($rawStructuredOutput.TrimEnd("r", "n"))
- Line 660:
Write-Host ([string]$line)
Eigenverft.Manifested.Agent.InvokeQwenTask.ps1
- Line 500:
Write-Host ([string]$record.Line)
- Line 582:
Write-Host ([string]$line)
Recommended Fix
Replace Write-Host with appropriate alternatives:
Write-Output - for general output
Write-Verbose - for verbose/diagnostic output
Write-Information - for informational messages that should be suppressible
Example
# Before
Write-Host ([string]$record.Line)
# After
Write-Output ([string]$record.Line)
# or
Write-Verbose ([string]$record.Line)
PSScriptAnalyzer Rule
PSAvoidUsingWriteHost
Issue
Multiple PowerShell files use
Write-Hostwhich is discouraged in PowerShell best practices.Write-Hosthas several limitations:Affected Files
Eigenverft.Manifested.Agent.InvokeCodexTask.ps1
Write-Host $textEigenverft.Manifested.Agent.InvokeGeminiTask.ps1
Write-Host ([string]$record.Line)Write-Host ([string]$line)Write-Host ($rawStructuredOutput.TrimEnd("r", "n"))Write-Host ([string]$line)Eigenverft.Manifested.Agent.InvokeQwenTask.ps1
Write-Host ([string]$record.Line)Write-Host ([string]$line)Recommended Fix
Replace
Write-Hostwith appropriate alternatives:Write-Output- for general outputWrite-Verbose- for verbose/diagnostic outputWrite-Information- for informational messages that should be suppressibleExample
PSScriptAnalyzer Rule
PSAvoidUsingWriteHost