(Copied from original User Voice forum)
"ogsRender is a very cool command to have custom scripted playblast but you need to have a proper project setted as you can't explicitly set a file path to write rendered frame on.
Please add a filePath argument to ogsRender command to override the file path and let the developper manage where frames are stored:
maya.cmds.ogsRender(filePath="/path/to/file.001.png')"