  We show that, for a coanalytic subspace $X$ of $2^\omega$, the countable
dense homogeneity of $X^\omega$ is equivalent to $X$ being Polish. This
strengthens a result of Hru\v{s}\'ak and Zamora Avil\'es. Then, inspired by
results of Hern\'andez-Guti\'errez, Hru\v{s}\'ak and van Mill, using a
technique of Medvedev, we construct a non-Polish subspace $X$ of $2^\omega$
such that $X^\omega$ is countable dense homogeneous. This gives the first
$\mathsf{ZFC}$ answer to a question of Hru\v{s}\'ak and Zamora Avil\'es.
Furthermore, since our example is consistently analytic, the equivalence result
mentioned above is sharp. Our results also answer a question of Medini and
Milovich. Finally, we show that if every countable subset of a zero-dimensional
separable metrizable space $X$ is included in a Polish subspace of $X$ then
$X^\omega$ is countable dense homogeneous.
