Any military campaign needs a clear objective and an achievable end state with contingencies planned. Even then something unexpected will still happen. Afghanistan, Vietnam, and Iraq were all very different conflicts and the current situation is different again.
As for rebuilding their capabilities, that is not trivial. Iran is still operating aircraft that we retired decades ago, which says something about their supply constraints.
The outcome also does not have to be installing a perfect government of our choosing. A more realistic result would be a government the United States can work with and one that the Iranian people actually support. That could still include parts of the current system if major and unpopular things changed.
I am sure someone in the current leadership would like to be the person who reduced the influence of the Islamic Revolutionary Guard Corps, loosened the grip of the religious leadership, and ended the country’s pariah status while getting sanctions lifted and money flowing back into the economy.
That would probably be a better outcome than trying to export our model of government to yet another Middle Eastern country.
Given he did take this clear victory and cash in, in Venezuela, there is some hope he'll do the same in Iran.