OnDrawGizmos to All children

Not a coder and have tried searching and struggling with this one. I’d like all the children of a parent joint/ bone (in [ExecuteInEditMode]) to receive the DrawLine and DrawSphere, but folowing code only goes one child down:

void OnDrawGizmos() {
	Gizmos.color = Color.blue;
	Gizmos.DrawSphere(transform.position, .012f);

	foreach (Transform child in transform){
	Gizmos.DrawLine(transform.position, child.position);
	}

Is it possible, without having to apply script to all children?

You can use a recursive method to traverse the whole tree.

void OnDrawGizmos() {
     DrawGizmos(transform);
}

private void DrawGizmos(Transform trans) {
     Gizmos.color = Color.blue;
     Gizmos.DrawSphere(trans.position, .012f);
     foreach (Transform child in trans) {
        Gizmos.DrawLine(trans.position, child.position);
        DrawGizmos(child);
    }
}