Depending, there are a couple of ways. Outdoor rated enclosures are cheap and you don't need much. I could put together a small solar panel, OD enclosure, charge controller, and small 12v battery for probably $100 plus an itty bitty 5 port switch that is probably going to use 2-3w even with that length of cable on both ends doesn't take much of a solar panel or battery to supply it and since 12v...no inverter needed.
I've designed outdoor "remote" access points the same way...except they aren't wired in. Wireless bridge connected to a wireless AP with a nice big omni(s) sticking out. Of course that requires a beefier battery and panel, but you can cover a lot still.
Or you do POE with a switch that'll take POE feed it that way and put it in a OD enclosure part way. Doesn't have to be buried, though if you really wanted to, you probably could. Either just bury it in a water tight box, or take the day to quick dig a small square hole, pour a thin concrete floor, put up a form, pour the sides to be slightly above ground level, then get a sheet of thick plastic for the top, stick the switch in that.