ConfigureRemotingForAnsible.ps1 - script

Hello everyone,

I’m trying to setup a windows host to accept Ansible commands using the steps below:

$url = “https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1”

$file = “$env:temp\ConfigureRemotingForAnsible.ps1”

(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)

powershell.exe -ExecutionPolicy ByPass -File $file

But the URL link does not exist anymore. Has it changed?

I get this error:

Exception calling “DownloadFile” with “2” argument(s): “The remote server returned an error: (404) Not Found.”
At line:1 char:1

  • (New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
  •   + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : WebException
    

Thank you
Kabamaru

Hello again.

I ended up manually downloading the script from here:

[ansible-windows/files/ConfigureRemotingForAnsible.ps1 at master · AlbanAndrieu/ansible-windows · GitHub]

Thank you

That script had been moved to ansible/ansible-documentation repository. You can find that under the examples/scripts directory.

However, in the first place, today, this script is not recommended.

You should read the README.md on the same directory carefully before using that: ansible-documentation/examples/scripts/README.md at devel · ansible/ansible-documentation · GitHub

2 Likes

Kurokodo,

Thank you for your reply. I will have a look at the README file.

All the best.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.