The 1968 the film classic 2001: A Space Odyssey showed orbiting nuclear bombs (seen at top) in establishing scenes (though they were not explicitly identified as space weapons). In one version of the Arthur C. Clarke and Stanley Kubrick screenplay the alien reincarnated "Star Child" defiantly explodes the space arsenal. Kubrick dropped this from the film ending because it was too similar to the ending of his 1964 dark comedy classic, Dr. Strangelove, which imagines a "doomsday machine" nuking all of Earth.
Ironically, a year earlier nearly 100 countries signed the Outer Space Treaty that bans the stationing of weapons of mass destruction beyond Earth. (In 1958 the U.S. detonated a couple low-yield tactical atomic bombs at high altitude over South Africa.) The treaty also prohibits the militarization of celestial bodies - so long Starship Troopers. This could become problematic if we ever considered launching a super-nuke to deflect an earthbound asteroid.
In the early 1980s President Ronald Regan envisioned a multi-layered defensive shield called the Strategic Defense Initiative (SDI) that was almost like the imaginary force field in sci-fi stories. The weapons envisioned were straight out of the film Star Wars. Among the proposed arsenal were particle beam weapons and orbiting gamma-ray lasers that would shoot soviet ICBMs out of the sky as effectively as the arcade game Missile Command. The laser would be powered by detonating a nuclear bomb in Earth orbit.