Loading an Ansys Ensight Software Session File from the Command Line

How to load an Ansys EnSightâ„¢ simulation data visualization software session file from the command line?

The following is the Python command for loading a session file:
ensight.objs.ensxml_restore_file(r""test.ens"")

If this command is put in a .py file, Ansys EnSight tool can be run from the command line with: ensight102 -p loadsession.py, which will run the Python file, and in turn load the session file.

Similarly, the following is the Python command for loading a context file:
ensight.file.restore_context("test.ctx")