In my grandparent's house, in the basement, the previous owner installed a bathroom on one side. They put up two walls, one separating it from the laundry room, the other from the "main" area.
My great uncle "installed" a light for my grandfather. Here's how he
Pic 1, a picture of the light. Yes that's a grounded outlet on the
Pic 2, a piece of two-wire (non-grounded) SO Cord run through the newer
wall, up and parallel to the joists. The cable is not "secured" at all
in the run.
Pic 3, the other end. It's plugged into a socket-to-receptacle adapter.
My finger's there to block the light glare.