I'm not sure why the script is breaking, but I've created an offline bundle and attached it to my original post. Using that bundle, I was successfully able to create an ISO using ESXi-Customizer-PS-v2.2.ps1 running in a PowerCLI shell.