Skip to content

Instantly share code, notes, and snippets.

@gfoss
Last active November 6, 2019 18:17
Show Gist options
  • Save gfoss/dd9b89b71c0bfc4829e765576c365158 to your computer and use it in GitHub Desktop.
Save gfoss/dd9b89b71c0bfc4829e765576c365158 to your computer and use it in GitHub Desktop.
quickly enable psremoting on Windows Hosts via PowerShell
function enablePSRemoting {
Enable-PSRemoting –force
Set-Service WinRM -StartMode Automatic
Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"}
Set-Item WSMan:localhost\client\trustedhosts -value *
Get-Item WSMan:\localhost\Client\TrustedHosts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment