A while ago I heard of  a nice characterization of compactness but I have never seen a written source  of it,  so I'm starting to doubt  it.  I'm looking  for a reference, or counterexample,  for the following .  Let $X$ be a Hausdorff topological space.  Then, $X$ is compact if and only if $X^{\kappa}$ is Lindelöf  for any cardinal $\kappa$.  

If the above is indeed a fact, can one restrict the class of $\kappa$'s for which the characterization is still valid? 

Note:  Here I'm thinking under ZFC.