Gives caps
player.additem 0000000f 10000
Adds as many caps to your inventory as the number at the end. The caps ID is fixed, so you can copy it as is.
Adding items in Fallout 4 works through ID numbers. Caps and bobby pins have fixed IDs, but for other items you need to find the ID with the search command. Once you learn the search command, you can reach every item in the game.
Most codes here need cheats turned on first. See the section on how to open the console.
tgm
player.additem 0000000f 10000
Adds as many caps to your inventory as the number at the end. The caps ID is fixed, so you can copy it as is.
player.additem 0000000a 100
Gives as many bobby pins as the number at the end. Handy if you want to get better at lockpicking.
help "fusion core" 0
Type the item's English name in quotation marks and the console lists the matches with their IDs. Use the ID you find in the add item command.
player.additem <id> 1
Replace the ID part with the ID you found with the search command. The number at the end is the quantity.