A cross-connect switch for fiber-optic communication networks employing a wavelength dispersive element, such as a grating, and a stack of regular (non-wavelength selective) cross bar switches using two-dimensional arrays of micromachined, electrically actuated, individually-tiltable, controlled deflection micro-mirrors for providing multiport switching capability for a plurality of wavelengths. Using a one-dimensional micromirror array, a fiber-optic based MEMS switched spectrometer that does not require mechanical motion of bulk components or large diode arrays can be constructed with readout capability for WDM network diagnosis or for general purpose spectroscopic applications.