Window title cannot be longer than 1023 characters

Can anyone take a look at this script please?

It’s being invoked exactly like this:
powershell -NoProfile -NoLogo -ExecutionPolicy Unrestricted -File deploy.ps1

However seems that whenever an external binary is called (nuget.exe for example on line 92) all the stdout goes into the Window Title (?!?) and the execution breaks with

Window title cannot be longer than 1023 characters
.

Any idea how in the world this can happen?

I’d actually surmise that the external command being run is being displayed in the title bar - which is what Cmd.exe does - and it’s too long to fit. I’ve not run into this, personally, though. I’ll ask around.