I wasn't happy with all the available options so I made this bracket. Made for mounting under a surface (desk, enclousure, etc.) but should work vertically too.
The open end is a looser fit while the stop end is friction fit. You can use the bracket without the latch but it's available for added safety.
Use an M3x6 or M3x8 flathead with a nylock.
I printed the stop end face up with supports in the center around the opening for the power cable, works fine.
The author marked this model as their own original creation.