I raised this topic two years ago, when we got our Husky pup Een and got a lot of negative feedback. Most folks (99%) are against an electronic/invisible fence.
Two years later we have been 100% successful and our dogs run free on an open 1 acre property, they are the joy of the neighborhood. My white lab has been on an invisible fence now almost 5 years, with no issues.
We will not have the dogs in the yard if we are not home, or at night when sleeping.
We live in a large very safe gated neighborhood though, so there is no risk from outside the property. This is an important consideration.
Also, the type of invisible fence is important, don't go cheap. Important features are warning prior to correction, adjustable width of the warning and correction yard zone and adjustable intensity of the correction. Also low battery alarm and fence integrity alarms are important features
Personally, if I had to contain Een in a small area with the only exercise being walks, I would not have a Husky. He loves to run and when the two dogs play running in the yard, some neighbors going by, stop to watch the show. One day I will post a video.