def test_command_with_error(windows_bash_session):
    """Test command execution with an error reported via Write-Error."""
    # Test a command that will write an error
    action = CmdRunAction(command="Write-Error 'Test Error'")
    result = windows_bash_session.execute(action)

    assert isinstance(result, CmdOutputObservation)
    # Error stream is captured and appended
    assert 'ERROR' in result.content
    # Our implementation should set exit code to 1 when errors occur in stream
    assert result.exit_code == 1
Test command execution with an error reported via Write-Error.
tests/unit/test_windows_bash.py