Invoking the Export-EsxImageProfile cmdlet from the ImageBuilder PowerCLI module fails with error:
Error retrieving file for VIB '<vib_name>': ('<vib_location>', "Unable to open VIB archive in streaming mode: '_SharedFile' object has no attribute 'writing'").
The cause of this issue is a bug found in Python 3.7.0 related to working with compressed files. The issue has been fixed as of version 3.7.1.
To workaround the issue,
For PowerCLI 13.0 - Please upgrade to a Python 3.7 version 3.7.1 or later.
For PowerCLI 13.1 or later - Please upgrade to Python 3.7.1 or later. VMware.ImageBuilder supports Python of versions 3.7, 3.8, 3.9, 3.10, 3.11.