You are not connected to a PRTG Server. Please connect first using Connect-PrtgServer

Hi.

I am trying to build a dashbord from where I can pause PRTG alarms.

Yesterday it was working but after a reboot my script is not working. I get this error:
[error] You are not connected to a PRTG Server. Please connect first using Connect-PrtgServer.

How can I automate “Connect-PrtgServer”?

I have access to my Powershell Universal setup via VScode and that is connected to my PRTG server. But I guess PU can’t see that for some reason.

Edit: I basically need to run this automatically: Connect-PrtgServer prtg.axy.com (New-Credential USERNAME PASSWORD)

Okay I got it working by change environment to ‘Integrated’

But why is this?