What's the actual invoke-sqlcmd call that you're making - it's not shown in the image you provided. Also, what do you have set for your -QueryTimeout value? Is it possible you're attempting to connect to a server that doesn't exist or one that doesn't accept connections? Have you tried making the invoke-sqlcmd connection with just a simple query to just validate that the connection works?