[SOLVED] Connection closed when using Powershell's "Invoke-RestMethod" on playcanvas URLs

Thanks, I read this stackoverflow answer and added this line to the top of my script:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

And it now returns fine.