Cannot execute any scripts in Powershell universal

Server 2019 Standard.
I haven’t tried running it outside of IIS.

Ideally, I want this setup in a somewhat complicated manner. Long story short, our environment has three completely seperate AD domains. I’m going to need to reach into all of them. Thus, ideally i can run this in IIS under an MSA account. That account is granted access to our secret vault server, Thycotic.
I use a custom powershell function to grab service account credentials from the secret vault, which can then be used to reach into the three domains (IE, one service account per domain). That part is another story. Ideally, I’d like to have it store these on a scheduled sync in the local vault, reaching out to Thycotic every so often to sync them down if they update.

What’s the difference running this as a service? It HAS to be run on HTTPS ports. I assume I can do that running as a service instead?