Last active
April 7, 2021 09:28
-
-
Save fatihtatoglu/57815b26532f2e8a5c1917ad3a2b7380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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) | |
$currentPolicy = Get-ExecutionPolicy -List | Where-Object Scope -eq "LocalMachine" | Select-Object ExecutionPolicy | |
if ($currentPolicy -ne "Unrestricted") { | |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force | |
} | |
&$file -Verbose | |
Set-ExecutionPolicy -ExecutionPolicy $currentPolicy | |
Write-Host "WinRM is configured." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment