FourierTransform[Piecewise[{{cos[t],t > 0 and t < 2*pi}}, 0], t, \[Omega]]