If adding fresh bacon: Spray the inside of your Instant Pot with non stick spray. Dice bacon, set to saute, and cook until bacon is lightly browned. Drain grease (can leave in for flavor but it will be greasier at the end when done). Or just use 1/2 c. bacon bits and skip this step. Deglaze pot and turn pot off.
If not adding bacon: Set pressure cooker to saute and add butter, melt. Add diced onion and garlic. Season with salt and pepper and cook for about 2 minutes.
Add mushrooms and saute until they have released some of their juices and liquid has evaporated. Add flour and stir so everything is combined.
Pour in the broth and half & half and stir until well combined. Allow to simmer until sauce has thickened to gravy-like consistency.
Lastly add the frozen green beans, stir. Then place lid on pressure cooker and seal vent.
Cook on pressure function, high for 5 minutes. Then do a quick release.
To thicken again set the pot to saute once again. Allow to bubble and let some of the liquid to evaporate and thicken up. If you'd like it thicker add 1 tbsp cornstarch in a bowl with some of your hot liquid. Whisk together until smooth and add into pot. Stir and it will thicken more.
Remember it will thicken as it sits and cools too so don't overdo the cornstarch/flour.