Top Gun movie
The late Cold War classic Top Gun is one of the most well-liked military movies of all time. It's combination of romance, comedy and never-seen-before aerial action was made possible by extensive support from the DOD, particularly the US Navy. It is credited with significantly boosting military recruitment, but it also had another mission.

The DOD's database on its collaborations with Hollywood says the film 'clearly portrayed the Navy in a very positive light', but it's the next comment that bothers me. The entry goes on, 'Film completed rehabilitation of the military's image, which had been savaged by the Vietnam war.'
Top Gun military propaganda

In sharp contrast to WW2 and the Korean war, Vietnam was rarely portrayed in cinema until several years after it was over. The US military weren't keen on making anti-war movies, even pulling out of one movie - Beach Red (1967) - after having agreed to support it, because they felt it would send out an anti-war message just as Vietnam was hotting up.
US Military Vietnam movies
Numerous other requests were rejected, while only a handful of Vietnam war films were ever supported by the Pentagon. While over 200 war films were made in both the 50s and the 60s, the 70s and 80s saw a drop-off in the genre, with public appetites soured by the failure in Korea and particularly in Vietnam. That a film - Top Gun - which is not about the Vietnam war could be seen as rescuing the military's image shows how much faith the Pentagon puts in the Hollywood propaganda machine.