A portable generator and an onboard genset are two different things. Also, time stored is also an issue.
For six months or so of storage time on a portable generator, I'd toss in SeaFoam/StarTron/Sta-Bil, run the genset, have it shut off by the fuel valve (as opposed to by the electric switch), and call it done. Killing it by the pet**** means the carb is run almost completely dry.
For longer, I'd use a fogging oil on the portable generator, or read how the manufacturer recommends storage.
Similar with an onboard Onan. Long periods get the OnaGard treatment, shorter times get the fuel tank filled with a fuel stabilizer.
Caveat: Tossing SeaFoam into a shared fuel tank may work too well, dislodging stuff and fouling the injectors on older engines. Do at one's own risk.