This blog post saved me a ton of time doing trial and error when I needed to implement something in powershell but couldn’t change the execution policy from the default restricted setting.
https://blog.netspi.com/15-ways-to-bypass-the-powershell-execution-policy/