Like the unique and exceptional weapons, there are some legendary weapons and armor which you can get only when you defeat a legendary enemy. On death these enemies will drop a legendary weapon or armor with a randomly selected bonus effect. Legendary armor can accommodate all of the mods used by similar items.
Like the other games on pc, Fallout 4 has Console Commands and Cheat Codes that you can use in the game. You can use these commands to modify your game and gameplay and with cheat codes you can get some general items as well as weapons and armor also.