This paper focuses on the islanded operation of microgrids. In this mode of operation, the microsources are required to cooperate autonomously to regulate the local grid voltage and frequency. Droop control is typically used to achieve this autonomous voltage and frequency regulation. Inverters having LCL output filters would cause voltage distortion to be present at the PCC of the local load when non-linear current is supplied to the load due to the voltage drop across the grid side inductor. Techniques to reduce the output voltage distortion typically consist of installing either passive or active filters to selectively compensate harmonic frequencies. However, by adding suitable control strategies to the inverters connected to the microgrid, the power quality of the microgrid can be improved without the installation of any additional equipment. In this paper, a capacitive virtual impedance loop, implemented in each of the microsource inverters, is proposed so as to dampen the voltage harmonics at the PCC of the local load. Simulation results are presented showing the suitability of the proposed algorithm in dampening the PCC voltage harmonics.