After much troubleshooting I was able to figure it out. It simply started working when I changed each echo statement to one of these:
New-UDParagraph -Text "Connecting to vSphere $vc"
I also noticed doing this it doesn’t write the live output what the script is doing, will only output everything when it’s all done. I guess that’s fine, would be cooler if it was live. Any tricks to get the live output?
If not I’m having a hard time figuring out progress bars in UD, I’ll type another post for that so we don’t start mixing threads. That thread here: Progress Bar Examples