Windows config script problems

It previously has always worked for me but now I’m getting an error

Unable to establish an HTTP or HTTPS remoting session.
At C:\users\stage\Desktop\configure_windows_for_ansible.ps1:129 char:5

  • Throw “Unable to establish an HTTP or HTTPS remoting session.”
  • CategoryInfo : OperationStopped: (Unable to estab…moting session.:String) , RuntimeException
  • FullyQualifiedErrorId : Unable to establish an HTTP or HTTPS remoting session.

The last line of the script is:
Write-Verbose “PS Remoting has been successfully configured for Ansible.”

I have NEVER seen this line printed when configuring ansible, despite the config script successfully enabling ansible to connect.

Can you double-check that you’re running as admin? OS / PowerShell version?

As for the write-verbose part, that only shows if you set $verbosePreference to “Continue”.

UPDATE
This must have something to do with active directory domain permissions bc when I remove the machine from the domain, then run the script, it completed.

(Though I still have never seen the final ansible configuration affirmation)