The first PowerShell is launched by using powershell.exe xxxx.ps1
It passes the name it reads from a file to the second PowerShell script – as evidenced by echo in the second script.
But as soon as the second (called) script runs ADD-PSSnapin…it fails:
#Load PowerCLI module in PowerShell
Add-PSSnapin VMware.VimAutomation.Core