How to solve opamp power input ERC warning if it is behind switch?

I have battery symbol with power output pins. I have opamp with power input pins. If I connect battery directly to opamp everything is OK.

However if I put switch in between them (all pins are passive) then ERC complains that opamp power input pin has no connection to any power output pins.

I found similar topic 4 years old: ERC - Power input pins and passive components

Did anything changed?

I wouldn’t mind excluding the marker but when I save file and re-run ERC it is back there, as if marker exclusions are not saved. I’m using 6.0.2

You can add a power flag to the net after the switch. It’s in the library with all of the power symbols.