Nowadays, in the modern power systems, due to increasing the application of renewable energy sources, power inverters are most commonly used electronic devices in the energy systems for ac/dc power conversion. Since the standard power inverters have extremely low inertia elements, the modern power systems meet insufficiency inertia to maintain the grid stability. In virtual synchronous generator (VSG) technique, virtual inertia is emulated in the power inverters by implementing swing equation and as a result, grid inertia is increased and grid stability will be satisfied. Although grid inertia issue is solved by VSG control, dealing with some power quality problems, such as grid current harmonic, which occurs in bad situations, has not been considered in this control theory. In this paper, a control approach based on a combination of VSG technique and amended fractional-order repetitive control (AFORC) is presented for grid-connected inverters to cope with the mentioned problem. The results of simulation studies proved that the proposed method besides fulfilling the main VSG objectives, such as transient frequency response enhancement and increasing total inertia of the power systems, it also can extremely diminish harmonic components of the current injected to the grid in the presence of distorted grid voltage and unbalanced nonlinear rectifier loads.