ALBANY — When life gives you lemons, make lemonade. Or craft a state law.

Last July, 7-year-old Brendan Mulvaney’s entrepreneurial dreams soured when Health Department officials shut down his lemonade stand for not having a $30 selling permit.

He was raising money for a Disney World family trip on his front porch, an ideal location across from the Saratoga County Fairgrounds, when bitter competitors — who were selling $7 cups of lemonade — ratted him out for charging 75 cents apiece.

But government did an about-face Tuesday, when a bill dubbed “Brendan’s Lemon-Aid Law” in the boy’s honor sailed through the state Senate Health Committee with bipartisan support.

“There’s nothing that says America more than apple pie and kids running lemonade stands,” said bill sponsor state Sen. Jim Tedesco (R-Glenville).

“It’s a sad commentary on the current state of New York state’s government that this legislation is needed to protect the entrepreneurial dreams of children selling lemonade,” he added.

“Kids like Brendan Mulvaney are trying to give people sweet lemonade and learn some important business skills but the overzealous state bureaucrats just keep giving taxpayers lemons.”

Brendan’s father, Sean Mulvaney, told The Post in a phone interview Thursday that his now-8-year-old son plans to bring his friends into the business.

“We filled him in when he came home from school [Tuesday]. He understands this law is more than just him, it’s his friends. He said he wants his other friends to come over and help him.”

Mulvaney said they plan to stick to regular lemonade, sno-cones and water — and will be ready to reopen in July.

“We might add some pink lemonade, too,” he said.

Brendan was at school Thursday morning and unavailable for immediate comment.

Once passed, the law would take effect immediately and exempt kids 16 and under from paying a $30 yearlong permit fee to run a lemonade stand.

Under current law, that permit is needed to run a “temporary food establishment.”

Gov. Andrew Cuomo last summer offered to personally pay the fees, calling the Health Department’s worry “ridiculous.” The stand eventually was reopened.

The legislation awaits further committee review in both the state Senate and Assembly before heading to Cuomo’s desk for his signature.